Skip to content

Conversation

@jbrown9513
Copy link
Member

This PR is for fixing the following issue - #45

Thanks to @marancibia for helping test this fix.

In line 817 convert_to_oci_tool uses "type": p_def.get("type", "any"), which defaults to a non json-schema comatible Type. This causes an error on the tool invocation.
https://json-schema.org/understanding-json-schema/reference/type

The recommendation for handling the type any from Json-object is to pass a list containing all types:
"any": ["string", "number", "integer", "boolean", "array", "object", "null"]

I am working to confirm that this is in-fact supported on OCI server side, otherwise I was considering defaulting to string or object as the Json Type. I also added a similar fix to recursively resolve Json Type for subclasses of BaseModel.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 16, 2025
@YouNeedCryDear YouNeedCryDear self-requested a review October 27, 2025 18:22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use this straighforward fix instead of the complicated logic?

Fix:
In line 817 use "type": p_def.get("type", "string"), instead of "type": p_def.get("type", "any"), since most tool parameters are strings anyway.


stop_sequence_key: str = "stop"

@staticmethod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this function under CohereProvider?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can omit these unit tests if we just use the straightforward fix: "type": p_def.get("type", "string"),

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

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants