fix function calling prompt - ask llm to respond in fahrenheit

This commit is contained in:
Ishaan Jaff
2024-04-16 21:09:53 -07:00
parent 7765e0054b
commit 5393930701
3 changed files with 28 additions and 5 deletions
+4 -1
View File
@@ -252,7 +252,10 @@ def test_bedrock_claude_3_tool_calling():
}
]
messages = [
{"role": "user", "content": "What's the weather like in Boston today?"}
{
"role": "user",
"content": "What's the weather like in Boston today in fahrenheit?",
}
]
response: ModelResponse = completion(
model="bedrock/anthropic.claude-3-sonnet-20240229-v1:0",
+12 -2
View File
@@ -167,7 +167,12 @@ def test_completion_claude_3_function_call():
},
}
]
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
messages = [
{
"role": "user",
"content": "What's the weather like in Boston today in Fahrenheit?",
}
]
try:
# test without max tokens
response = completion(
@@ -376,7 +381,12 @@ def test_completion_claude_3_function_plus_image():
]
tool_choice = {"type": "function", "function": {"name": "get_current_weather"}}
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
messages = [
{
"role": "user",
"content": "What's the weather like in Boston today in Fahrenheit?",
}
]
response = completion(
model="claude-3-sonnet-20240229",
+12 -2
View File
@@ -2252,7 +2252,12 @@ def test_completion_claude_3_function_call_with_streaming():
},
}
]
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
messages = [
{
"role": "user",
"content": "What's the weather like in Boston today in fahrenheit?",
}
]
try:
# test without max tokens
response = completion(
@@ -2306,7 +2311,12 @@ async def test_acompletion_claude_3_function_call_with_streaming():
},
}
]
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
messages = [
{
"role": "user",
"content": "What's the weather like in Boston today in fahrenheit?",
}
]
try:
# test without max tokens
response = await acompletion(