-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/custom-config-ninja-api
- Loading branch information
Showing
6 changed files
with
515 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
196 changes: 196 additions & 0 deletions
196
tests/cassettes/test_views/test_create_thread_message.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
interactions: | ||
- request: | ||
body: '{"messages": [{"content": "You are a temperature bot. Today is 2024-06-09.", | ||
"role": "system"}, {"content": "Hello, what is the temperature in SF right now?", | ||
"role": "user"}], "model": "gpt-4o", "n": 1, "stream": true, "temperature": | ||
1.0, "tools": [{"type": "function", "function": {"name": "fetch_current_temperature", | ||
"description": "Fetch the current temperature data for a location", "parameters": | ||
{"type": "object", "properties": {"location": {"type": "string"}}, "required": | ||
["location"]}}}, {"type": "function", "function": {"name": "fetch_forecast_temperature", | ||
"description": "Fetch the forecast temperature data for a location", "parameters": | ||
{"type": "object", "properties": {"location": {"type": "string"}, "dt_str": | ||
{"description": "Date in the format ''YYYY-MM-DD''", "type": "string"}}, "required": | ||
["location", "dt_str"]}}}]}' | ||
headers: | ||
accept: | ||
- application/json | ||
accept-encoding: | ||
- gzip, deflate | ||
authorization: | ||
- DUMMY | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '840' | ||
content-type: | ||
- application/json | ||
host: | ||
- api.openai.com | ||
user-agent: | ||
- OpenAI/Python | ||
method: POST | ||
uri: https://api.openai.com/v1/chat/completions | ||
response: | ||
body: | ||
string: 'data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_DSkKzAmCkD4pfwMPxeDZbXmN","type":"function","function":{"name":"fetch_current_temperature","arguments":""}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"San"}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" | ||
Francisco"}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" | ||
CA"}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0n4JXzttxBAJOECR6Rcmb2ZrFe","object":"chat.completion.chunk","created":1718801253,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_f4e629d0a5","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}]} | ||
data: [DONE] | ||
' | ||
headers: | ||
Connection: | ||
- keep-alive | ||
Content-Type: | ||
- text/event-stream; charset=utf-8 | ||
Date: Sun, 09 Jun 2024 23:39:08 GMT | ||
Server: DUMMY | ||
Transfer-Encoding: | ||
- chunked | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: '{"messages": [{"content": "You are a temperature bot. Today is 2024-06-09.", | ||
"role": "system"}, {"content": "Hello, what is the temperature in SF right now?", | ||
"role": "user"}, {"content": null, "role": "assistant", "tool_calls": [{"type": | ||
"function", "id": "call_DSkKzAmCkD4pfwMPxeDZbXmN", "function": {"name": "fetch_current_temperature", | ||
"arguments": "{\"location\": \"San Francisco, CA\"}"}}]}, {"content": "32 degrees | ||
Celsius", "role": "tool", "tool_call_id": "call_DSkKzAmCkD4pfwMPxeDZbXmN"}], | ||
"model": "gpt-4o", "n": 1, "stream": true, "temperature": 1.0, "tools": [{"type": | ||
"function", "function": {"name": "fetch_current_temperature", "description": | ||
"Fetch the current temperature data for a location", "parameters": {"type": | ||
"object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}}, | ||
{"type": "function", "function": {"name": "fetch_forecast_temperature", "description": | ||
"Fetch the forecast temperature data for a location", "parameters": {"type": | ||
"object", "properties": {"location": {"type": "string"}, "dt_str": {"description": | ||
"Date in the format ''YYYY-MM-DD''", "type": "string"}}, "required": ["location", | ||
"dt_str"]}}}]}' | ||
headers: | ||
accept: | ||
- application/json | ||
accept-encoding: | ||
- gzip, deflate | ||
authorization: | ||
- DUMMY | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '1162' | ||
content-type: | ||
- application/json | ||
cookie: | ||
- DUMMY | ||
host: | ||
- api.openai.com | ||
user-agent: | ||
- OpenAI/Python | ||
method: POST | ||
uri: https://api.openai.com/v1/chat/completions | ||
response: | ||
body: | ||
string: 'data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
current"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
temperature"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
in"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
San"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
Francisco"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
CA"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
is"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":"32"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
degrees"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":" | ||
Celsius"},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]} | ||
data: {"id":"chatcmpl-9bp0oyb19UTjSTZGIZ9S9iH1Tedxm","object":"chat.completion.chunk","created":1718801254,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_9cb5d38cf7","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]} | ||
data: [DONE] | ||
' | ||
headers: | ||
Connection: | ||
- keep-alive | ||
Content-Type: | ||
- text/event-stream; charset=utf-8 | ||
Date: Sun, 09 Jun 2024 23:39:08 GMT | ||
Server: DUMMY | ||
Transfer-Encoding: | ||
- chunked | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.