mirror of
https://github.com/vxcontrol/langchaingo.git
synced 2026-07-19 13:45:47 -04:00
1c3dd0fca4
- Upgraded various AWS SDK dependencies in go.mod and go.sum files to their latest versions, improving compatibility and performance. - Introduced automatic caching support for specific Anthropic models, optimizing token usage and reducing costs. - Refactored message processing to include caching logic, ensuring seamless integration with existing functionalities. - Removed deprecated models from tests and updated test cases to validate new caching features and model support.
44 lines
20 KiB
Plaintext
Generated
44 lines
20 KiB
Plaintext
Generated
httprr trace v1
|
|
5775 654
|
|
POST https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-5-20250929-v1%3A0/converse HTTP/1.1
|
|
Host: bedrock-runtime.us-east-1.amazonaws.com
|
|
User-Agent: langchaingo-httprr
|
|
Content-Length: 5470
|
|
Authorization: AWS4-HMAC-SHA256 test-api-key
|
|
Content-Type: application/json
|
|
|
|
{"inferenceConfig":{"maxTokens":512},"messages":[{"content":[{"text":"What's the weather in Boston?"},{"cachePoint":{"ttl":"5m","type":"default"}}],"role":"user"}],"system":[{"text":"BedrockConverseAutoCacheTest-v1: You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. "},{"cachePoint":{"ttl":"5m","type":"default"}}],"toolConfig":{"toolChoice":{"auto":{}},"tools":[{"toolSpec":{"description":"BedrockConverseAutoCacheTest-v1: Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. ","inputSchema":{"json":{"properties":{"location":{"description":"City and state, e.g. San Francisco, CA","type":"string"}},"required":["location"],"type":"object"}},"name":"get_weather"}}]}}HTTP/2.0 200 OK
|
|
Content-Length: 489
|
|
Content-Type: application/json
|
|
Date: Tue, 03 Mar 2026 21:48:45 GMT
|
|
X-Amzn-Requestid: 5ef614ca-5045-4baf-995e-e27fb4cad3a7
|
|
|
|
{"metrics":{"latencyMs":2618},"output":{"message":{"content":[{"toolUse":{"input":{"location":"Boston, MA"},"name":"get_weather","toolUseId":"tooluse_1ncUndhOL9u3hhFVuhOwlP","type":"tool_use"}}],"role":"assistant"}},"stopReason":"tool_use","usage":{"cacheDetails":[{"inputTokens":1365,"ttl":"5m"}],"cacheReadInputTokenCount":0,"cacheReadInputTokens":0,"cacheWriteInputTokenCount":1365,"cacheWriteInputTokens":1365,"inputTokens":3,"outputTokens":55,"serverToolUsage":{},"totalTokens":1423}}6083 629
|
|
POST https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-5-20250929-v1%3A0/converse HTTP/1.1
|
|
Host: bedrock-runtime.us-east-1.amazonaws.com
|
|
User-Agent: langchaingo-httprr
|
|
Content-Length: 5778
|
|
Authorization: AWS4-HMAC-SHA256 test-api-key
|
|
Content-Type: application/json
|
|
|
|
{"inferenceConfig":{"maxTokens":512},"messages":[{"content":[{"text":"What's the weather in Boston?"}],"role":"user"},{"content":[{"toolUse":{"input":{"location":"Boston, MA"},"name":"get_weather","toolUseId":"tooluse_1ncUndhOL9u3hhFVuhOwlP"}}],"role":"assistant"},{"content":[{"toolResult":{"content":[{"text":"{\"temperature\": 72, \"condition\": \"sunny\"}"}],"toolUseId":"tooluse_1ncUndhOL9u3hhFVuhOwlP"}},{"cachePoint":{"ttl":"5m","type":"default"}}],"role":"user"}],"system":[{"text":"BedrockConverseAutoCacheTest-v1: You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. "},{"cachePoint":{"ttl":"5m","type":"default"}}],"toolConfig":{"toolChoice":{"auto":{}},"tools":[{"toolSpec":{"description":"BedrockConverseAutoCacheTest-v1: Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. ","inputSchema":{"json":{"properties":{"location":{"description":"City and state, e.g. San Francisco, CA","type":"string"}},"required":["location"],"type":"object"}},"name":"get_weather"}}]}}HTTP/2.0 200 OK
|
|
Content-Length: 464
|
|
Content-Type: application/json
|
|
Date: Tue, 03 Mar 2026 21:48:48 GMT
|
|
X-Amzn-Requestid: ba5d0941-90f6-4e82-ac10-2c5a953f3227
|
|
|
|
{"metrics":{"latencyMs":2275},"output":{"message":{"content":[{"text":"The weather in Boston, MA is currently sunny with a temperature of 72°F. It's a beautiful day!"}],"role":"assistant"}},"stopReason":"end_turn","usage":{"cacheDetails":[{"inputTokens":77,"ttl":"5m"}],"cacheReadInputTokenCount":1365,"cacheReadInputTokens":1365,"cacheWriteInputTokenCount":77,"cacheWriteInputTokens":77,"inputTokens":6,"outputTokens":27,"serverToolUsage":{},"totalTokens":1475}}6328 656
|
|
POST https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-5-20250929-v1%3A0/converse HTTP/1.1
|
|
Host: bedrock-runtime.us-east-1.amazonaws.com
|
|
User-Agent: langchaingo-httprr
|
|
Content-Length: 6023
|
|
Authorization: AWS4-HMAC-SHA256 test-api-key
|
|
Content-Type: application/json
|
|
|
|
{"inferenceConfig":{"maxTokens":512},"messages":[{"content":[{"text":"What's the weather in Boston?"}],"role":"user"},{"content":[{"toolUse":{"input":{"location":"Boston, MA"},"name":"get_weather","toolUseId":"tooluse_1ncUndhOL9u3hhFVuhOwlP"}}],"role":"assistant"},{"content":[{"toolResult":{"content":[{"text":"{\"temperature\": 72, \"condition\": \"sunny\"}"}],"toolUseId":"tooluse_1ncUndhOL9u3hhFVuhOwlP"}}],"role":"user"},{"content":[{"text":"The weather in Boston, MA is currently sunny with a temperature of 72°F. It's a beautiful day!"},{"cachePoint":{"ttl":"5m","type":"default"}}],"role":"assistant"},{"content":[{"text":"What about New York?"},{"cachePoint":{"ttl":"5m","type":"default"}}],"role":"user"}],"system":[{"text":"BedrockConverseAutoCacheTest-v1: You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. You are a helpful assistant with access to weather capabilities. "},{"cachePoint":{"ttl":"5m","type":"default"}}],"toolConfig":{"toolChoice":{"auto":{}},"tools":[{"toolSpec":{"description":"BedrockConverseAutoCacheTest-v1: Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. Get current weather conditions including temperature, humidity, wind speed, and precipitation for a specified geographic location. ","inputSchema":{"json":{"properties":{"location":{"description":"City and state, e.g. San Francisco, CA","type":"string"}},"required":["location"],"type":"object"}},"name":"get_weather"}}]}}HTTP/2.0 200 OK
|
|
Content-Length: 491
|
|
Content-Type: application/json
|
|
Date: Tue, 03 Mar 2026 21:48:51 GMT
|
|
X-Amzn-Requestid: e7fb5f6b-35d0-4e8e-85c3-5bc916ba5fd3
|
|
|
|
{"metrics":{"latencyMs":2392},"output":{"message":{"content":[{"toolUse":{"input":{"location":"New York, NY"},"name":"get_weather","toolUseId":"tooluse_aeSvV8u2CNRzTPCTwjgT4x","type":"tool_use"}}],"role":"assistant"}},"stopReason":"tool_use","usage":{"cacheDetails":[{"inputTokens":38,"ttl":"5m"}],"cacheReadInputTokenCount":1442,"cacheReadInputTokens":1442,"cacheWriteInputTokenCount":38,"cacheWriteInputTokens":38,"inputTokens":3,"outputTokens":56,"serverToolUsage":{},"totalTokens":1539}} |