Skip to content

Conversation

jiapingzeng
Copy link
Contributor

Description

Create bedrock/converse interface while keeping backwards compatibility with bedrock/converse/claude

Related Issues

Resolves #4122

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@jiapingzeng
Copy link
Contributor Author

This works with Claude but I am running into issues when using other models. E.g. Meta Llama not getting tool output:

{
    "inference_results": [{
        "output": [{
            "name": "memory_id",
            "result": "m1wIc5kB5X7jGYd1Hpnk"
        }, {
            "name": "parent_interaction_id",
            "result": "nFwIc5kB5X7jGYd1Hpn2"
        }, {
            "name": "response",
            "result": "{\"metrics\":{\"latencyMs\":200.0},\"output\":{\"message\":{\"content\":[{\"toolUse\":{\"input\":{\"indices\":[]},\"name\":\"ListIndexTool\",\"toolUseId\":\"tooluse_68VjCTpwQyCJXsGni5zLBw\"}}],\"role\":\"assistant\"}},\"stopReason\":\"tool_use\",\"usage\":{\"inputTokens\":353.0,\"outputTokens\":18.0,\"serverToolUsage\":{},\"totalTokens\":371.0}}"
        }, {
            "name": "response",
            "result": "row,health,status,index,uuid,pri(number of primary shards),rep(number of replica shards),docs.count(number of available documents),docs.deleted(number of deleted documents),store.size(store size of primary and replica shards),pri.store.size(store size of primary shards)\n1,green,open,.plugins-ml-model-group,ykq3mq77RSW5fl3irCTlcA,1,0,1,9,70.2kb,70.2kb\n2,green,open,.plugins-ml-memory-message,jOMVlHcYQUm2vKZ5A28y9Q,1,0,30,7,69.2kb,69.2kb\n3,green,open,.plugins-ml-memory-meta,c6863zhnTZKVt0aQJHrbLA,1,0,10,31,9.2kb,9.2kb\n4,green,open,.plugins-ml-config,tj0c4Z5hTveuJEDgl1QtwA,1,0,1,0,4kb,4kb\n5,green,open,.plugins-ml-model,N0CWyCV4S2aVe5h06n28mw,1,0,10,20,14.6kb,14.6kb\n6,green,open,.plugins-ml-agent,DV-IPsRBQLmq5f45qDTdjA,1,0,10,0,157.8kb,157.8kb\n7,green,open,.plugins-ml-task,rF6pY0qdTCO9t5NRqH6p7Q,1,0,20,28,71.9kb,71.9kb\n8,green,open,.plugins-ml-connector,a822uoStQ3Sy9zr8oNeJiA,1,0,10,0,316.5kb,316.5kb\n"
        }, {
            "name": "response",
            "result": "The ListIndexTool function is used to retrieve information about the indices in the OpenSearch cluster. The function call with an empty list as the argument for 'indices' returns information about all the indices in the cluster. The response includes details such as the health, status, index name, UUID, number of primary and replica shards, document count, deleted documents, and store size for each index."
        }]
    }]
}

I believe this is due to the tool use request format is different for different models. Would need more refactoring to make it work with other models.

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.

[Enhancement] add default bedrock converse LLM interface
1 participant