Skip to content

Conversation

@konradszymanski
Copy link
Contributor

create_tool_from_schema now updates existing tools instead of failing on unique constraint.

Problem:
When calling create_tool_from_schema with an existing tool code, it failed with:
ORA-00001: unique constraint (KS.UC_AI_TOOLS_UK) violated on table KS.UC_AI_TOOLS columns (CODE)

Solution:

Check if tool with same code exists before insert
If exists: update the tool record, delete and recreate parameters and tags
If not exists: create new tool as before
Use Case:
Users may call uc_ai_tools_api.create_tool_from_schema multiple times to quickly update parameter values, tool instructions, or other tool configuration without needing to manually delete the tool first.

Changes:

uc_ai_tools_api.pkb: Added upsert logic to create_tool_from_schema
uc_ai_tools_api.pks: Updated documentation to reflect new behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant