Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OCI Generative AI tool calling support #16888

Conversation

LejianLeoHe7
Copy link
Contributor

Description

Adding tool calling support for chat models offered by OCI Generative AI services.
This is an update to our last PR #14080.

Fixes # (issue)
N/A

New Package?

No

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes
  • No

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 8, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -219,6 +190,7 @@ def _get_all_kwargs(self, **kwargs: Any) -> Dict[str, Any]:
**kwargs,
}

@deprecated("Deprecated in favor of `chat`, which should be used instead.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

technically, you can make complete call chat -- we have utils to make this very easy. A few llms do this

Choose a reason for hiding this comment

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

Thank you @logan-markewich Agreed. But basically all the models that support completion have been deprecated in our service. Let me take a look at other vendors.

**chat_params,
}

def chat_with_tools(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically you shouldn't need to implement chat_with_tools or stream_chat_with_tools -- the idea is that chat and stream chat already handle tools being passed in/out, and all you need to implement is _prepare_chat_with_tools() and get_tool_calls_from_response() and maybe _validate_chat_with_tools_response()

Check out anthropic or Ollama for a decent example of this

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @logan-markewich , I have updated chat and stream_chat and also removed chat_with_tools/stream_chat_with_tools in our implementation. We tested both chat/stream_chat with and without tools, which worked fine. Thanks for the suggestions!

@YouNeedCryDear
Copy link

@logan-markewich Hi, we have addressed all your comments. Please take another look when you have a moment and let us know if there are any remaining issues. We’re eager to get this merged, as our customers are eagerly awaiting this feature.

@YouNeedCryDear
Copy link

@logan-markewich Hi, could you kindly take a look at the PR when you've got time?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 19, 2024
@logan-markewich logan-markewich enabled auto-merge (squash) December 19, 2024 02:56
@logan-markewich logan-markewich merged commit ff661ea into run-llama:main Dec 19, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants