use passed in model name in chat completion request

This commit is contained in:
Adil Hafeez 2025-03-21 14:46:45 -07:00
parent bd8004d1ae
commit 7331c415aa
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
10 changed files with 299 additions and 49 deletions

View file

@ -2,7 +2,6 @@ POST http://localhost:12000/v1/chat/completions
Content-Type: application/json
{
"model": "--",
"messages": [
{
"role": "system",
@ -13,5 +12,13 @@ Content-Type: application/json
"content": "I want to sell red shoes"
}
],
"stream": true
"stream": false
}
HTTP 200
[Asserts]
header "content-type" == "application/json"
jsonpath "$.model" matches /^gpt-4o-mini/
jsonpath "$.usage" != null
jsonpath "$.choices[0].message.content" != null
jsonpath "$.choices[0].message.role" == "assistant"

View file

@ -0,0 +1,25 @@
POST http://localhost:12000/v1/chat/completions
Content-Type: application/json
{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant.\n"
},
{
"role": "user",
"content": "I want to sell red shoes"
}
],
"stream": false
}
HTTP 200
[Asserts]
header "content-type" == "application/json"
jsonpath "$.model" matches /^gpt-3.5-turbo/
jsonpath "$.usage" != null
jsonpath "$.choices[0].message.content" != null
jsonpath "$.choices[0].message.role" == "assistant"

View file

@ -0,0 +1,25 @@
POST http://localhost:12000/v1/chat/completions
Content-Type: application/json
x-arch-llm-provider-hint: gpt-4o
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant.\n"
},
{
"role": "user",
"content": "I want to sell red shoes"
}
],
"stream": false
}
HTTP 200
[Asserts]
header "content-type" == "application/json"
jsonpath "$.model" matches /^gpt-4o-2/
jsonpath "$.usage" != null
jsonpath "$.choices[0].message.content" != null
jsonpath "$.choices[0].message.role" == "assistant"