Skip to content

Commit

Permalink
Rename test to test_openai_chat_model_acomplete_ollama (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmpcollins authored Nov 29, 2024
1 parent 142d46f commit c7a2fe3
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 179 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ asyncio_mode = "auto"
markers = [
"anthropic: Tests that query the Anthropic API. Requires the ANTHROPIC_API_KEY environment variable to be set.",
"litellm_anthropic: Tests that query the Anthropic API via litellm. Requires the ANTHROPIC_API_KEY environment variable to be set.",
"litellm_ollama: Tests that query Ollama via Litellm. Requires ollama to be installed and running on localhost:11434.",
"litellm_ollama: Tests that query Ollama via litellm. Requires ollama to be installed and running on localhost:11434.",
"litellm_openai: Tests that query the OpenAI API via litellm. Requires the OPENAI_API_KEY environment variable to be set.",
"mistral: Tests that query the Mistral API (via openai). Requires the MISTRAL_API_KEY environment variable to be set.",
"openai: Tests that query the OpenAI API. Requires the OPENAI_API_KEY environment variable to be set.",
"openai_ollama: Tests that query Ollama via OpenAI. Requires ollama to be installed and running on localhost:11434.",
"openai_ollama: Tests that query Ollama via openai. Requires ollama to be installed and running on localhost:11434.",
]

[tool.ruff]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ interactions:
uri: http://localhost:11434/v1/chat/completions
response:
body:
string: 'data: {"id":"chatcmpl-573","object":"chat.completion.chunk","created":1732915688,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"","tool_calls":[{"id":"call_wqha42ih","type":"function","function":{"name":"return_bool","arguments":"{\"value\":true}"}}]},"finish_reason":null}]}
string: 'data: {"id":"chatcmpl-148","object":"chat.completion.chunk","created":1732916961,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"","tool_calls":[{"id":"call_j25hbnia","type":"function","function":{"name":"return_bool","arguments":"{\"value\":true}"}}]},"finish_reason":null}]}
data: {"id":"chatcmpl-573","object":"chat.completion.chunk","created":1732915688,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-148","object":"chat.completion.chunk","created":1732916961,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: [DONE]
Expand All @@ -55,7 +55,7 @@ interactions:
Content-Type:
- text/event-stream
Date:
- Fri, 29 Nov 2024 21:28:08 GMT
- Fri, 29 Nov 2024 21:49:21 GMT
Transfer-Encoding:
- chunked
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ interactions:
uri: http://localhost:11434/v1/chat/completions
response:
body:
string: 'data: {"id":"chatcmpl-877","object":"chat.completion.chunk","created":1732915691,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"","tool_calls":[{"id":"call_kichi5ua","type":"function","function":{"name":"return_list_of_int","arguments":"{\"value\":\"[1,
string: 'data: {"id":"chatcmpl-622","object":"chat.completion.chunk","created":1732916932,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"","tool_calls":[{"id":"call_d45b8f5x","type":"function","function":{"name":"return_list_of_int","arguments":"{\"value\":\"[1,
2, 3, 4, 5]\"}"}}]},"finish_reason":null}]}
data: {"id":"chatcmpl-877","object":"chat.completion.chunk","created":1732915691,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-622","object":"chat.completion.chunk","created":1732916932,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: [DONE]
Expand All @@ -57,7 +57,7 @@ interactions:
Content-Type:
- text/event-stream
Date:
- Fri, 29 Nov 2024 21:28:11 GMT
- Fri, 29 Nov 2024 21:48:52 GMT
Transfer-Encoding:
- chunked
status:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
interactions:
- request:
body: '{"messages": [{"role": "user", "content": "Say hello!"}], "model": "llama3.1",
"stream": true, "stream_options": {"include_usage": true}}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '137'
content-type:
- application/json
host:
- localhost:11434
user-agent:
- AsyncOpenAI/Python 1.54.4
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.54.4
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.10.15
method: POST
uri: http://localhost:11434/v1/chat/completions
response:
body:
string: 'data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916924,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916924,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916924,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
It"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916924,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"''s"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916924,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
nice"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
to"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
meet"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
you"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
Is"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
there"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
something"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
I"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
can"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
help"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
with"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916925,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
or"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
would"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
you"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
like"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
to"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"
chat"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"?"},"finish_reason":null}]}
data: {"id":"chatcmpl-894","object":"chat.completion.chunk","created":1732916926,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: [DONE]
'
headers:
Content-Type:
- text/event-stream
Date:
- Fri, 29 Nov 2024 21:48:44 GMT
Transfer-Encoding:
- chunked
status:
code: 200
message: OK
version: 1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ interactions:
uri: http://localhost:11434/v1/chat/completions
response:
body:
string: 'data: {"id":"chatcmpl-341","object":"chat.completion.chunk","created":1732915676,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"","tool_calls":[{"id":"call_dxlghlch","type":"function","function":{"name":"return_bool","arguments":"{\"value\":true}"}}]},"finish_reason":null}]}
string: 'data: {"id":"chatcmpl-826","object":"chat.completion.chunk","created":1732916920,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":"","tool_calls":[{"id":"call_kve3oltz","type":"function","function":{"name":"return_bool","arguments":"{\"value\":true}"}}]},"finish_reason":null}]}
data: {"id":"chatcmpl-341","object":"chat.completion.chunk","created":1732915676,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-826","object":"chat.completion.chunk","created":1732916920,"model":"llama3.1","system_fingerprint":"fp_ollama","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop"}]}
data: [DONE]
Expand All @@ -55,7 +55,7 @@ interactions:
Content-Type:
- text/event-stream
Date:
- Fri, 29 Nov 2024 21:27:56 GMT
- Fri, 29 Nov 2024 21:48:40 GMT
Transfer-Encoding:
- chunked
status:
Expand Down
Loading

0 comments on commit c7a2fe3

Please sign in to comment.