Skip to content

Conversation

@qiuosier
Copy link
Member

This PR fixes #16 .

The OCI GenAI APIs for models using the GenericProvider requires tools to use json schema types.
The tool parameter types prepared by LangChain are already json schema types. They should not be converted to python types.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 13, 2025
@qiuosier qiuosier changed the title Do not convert json schema types to python for tools in GenericProvider. Do not convert json schema types to python types for tools in GenericProvider. Aug 13, 2025
@YouNeedCryDear
Copy link
Member

@qiuosier
Can you update the test cases as well?

@qiuosier
Copy link
Member Author

Hi @YouNeedCryDear , there seems to be errors on the existing tests, so I updated them. Some of the payloads are updated based on what I received from the API calls.
Also, I updated the PR with the following:

  1. Fixed a bug in the _get_provider() function introduced by Support OpenAI and xAI models #13 , I made a mistake when updating the code.
  2. Added a test(test_get_provider) for the _get_provider() function.
  3. Added assertions to the mocked_response of test_meta_tool_conversion for checking the parameter types (updated by this PR).

Following is a screenshot of the test run outputs.
image

@YouNeedCryDear YouNeedCryDear self-requested a review August 14, 2025 19:28
@YouNeedCryDear YouNeedCryDear merged commit 2b231b4 into oracle:main Aug 14, 2025
1 check passed
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.

Invalid function schema error when adding tools with arguments to models with GenericProvider

2 participants