Skip to content

Conversation

yjean
Copy link
Contributor

@yjean yjean commented Apr 10, 2024

So Cohere can provide a reply based on the results of function calling.

@@ -34,6 +34,7 @@ def chat(
frequency_penalty: nil,
presence_penalty: nil,
tools: [],
tool_results: nil,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would personally put tool_results: [] and then below:

req.body[:tool_results] = tool_results if tool_results.any?

tools: tool,
tool_results: [
{
rows: [['Ruby', 42]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this correct format? The docs mention the following format:

tool_results = [
  {
    "call": {
      "name": <tool name>,
      "parameters": {
        <param name>: <param value>
      }
    },
    "outputs": [{
      <key>: <value>
    }]
  },
  ...
]

@andreibondarev
Copy link
Collaborator

@yjean Do you think you could add the missing spec for the chat() method? It would be nice if the test also included passing tools: and tool_results: params.

yjean and others added 3 commits May 3, 2024 10:01
otherwise, the conversation_id is ignored by Cohere
To restore behavior prior to 6/10/2024 change
@andreibondarev
Copy link
Collaborator

@yjean Just making sure you saw my comments here.

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