Skip to content

Add Cohere API agent #4

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

harry-cohere
Copy link

Thanks for publishing Tool Sandbox! It's been a lot of fun to work with so far, and it's great to see your efforts open sourced.

It's noted in the paper that Cohere models are incapable of consuming tool responses, and the implementation therefore achieves a lower score. This isn't the case, however, as all versions of Command R and Command R+ (including those on HF) work well with tool responses.

My PR contains an agent that uses the Cohere hosted API, but it's also possible to use a locally hosted version together with our prompting guide. These prompts are also in our Langchain package.

The API agent in this PR is implemented in a similar fashion to other API based agents. My thinking was that it's simpler to use the hosted API version, but if the preference is to use the locally hosted version please let me know and I'd be happy to implement it.

When I ran these agents I got a score that approximately doubled - if desired I can share the score that my run of the agents achieved.

@jiarui-lu2
Copy link
Collaborator

Hi @harry-cohere thanks for the PR! We do have a few points we wanted to discuss:

  • Is it possible to do a locally hosted version instead? For open source models, we felt that the community is going to appreciate it more if they have the freedom to customize the endpoint as they please.
  • Thanks for the pointer to prompting guide. Was this document introduced somewhat recently? When we implemented the current Cohere Agent implementation we weren't able to find a document like this.

@harry-cohere
Copy link
Author

Hello @jiarui-lu2 thanks for your reply!

Is it possible to do a locally hosted version instead?

That's a great idea - I can implement it! Could we keep both the API agent and the local version? We support both offerings, the scores are similar, and the API version is easier to get started with if you don't have a local model.

Was this document introduced somewhat recently? When we implemented the current Cohere Agent implementation we weren't able to find a document like this.

The models have had this capability since launch, and the specific document I linked has been present since then. Here's a cached copy from March which includes details on how to prompt with tool results, and I believed it's always been linked from the model card. I can see that we've made edits to documentation to make sure that everything is documented as clearly as possible, though.

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.

2 participants