Skip to content

Conversation

@17ColinMiPerry
Copy link
Contributor

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

Relevant Issues

resolves #4490

What is in this change?

Adds @agent support for Cohere. Uses v1 SDK to be consistent with the LLM provider implementation.

#convertChatHistoryCohere: converts standard messages to the format expected by Cohere.
#handleFunctionCallStream/Chat: Complies to Cohere API by passing message + chat_history
streamingFunctionCall: Overridden from UnTooled to handle Cohere's stream event format
stream/complete: Overrides to handle Cohere's SDK response structure

Additional Information

Currently, we don't have the @langchain/cohere package, so there is no LangChain integration.
https://docs.cohere.com/v1/reference/about

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@17ColinMiPerry
Copy link
Contributor Author

The v1 SDK was used to be consistent with the rest of the repository. However, it seems that v1 is largely being deprecated, and v2 is OpenAI-like. Would it be meaningful to convert this part of the codebase (and the Cohere LLM provider) to the v2 SDK API at this time?

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.

[FEAT]: Cohere @agent implemention

1 participant