-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: consolidate azure with openai provider #60
Merged
+239
−141
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,68 @@ | ||
interactions: | ||
- request: | ||
body: '{"messages": [{"role": "system", "content": "You are a helpful assistant."}, | ||
{"role": "user", "content": "Hello"}], "model": "gpt-4o-mini"}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
api-key: | ||
- test_azure_api_key | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '139' | ||
content-type: | ||
- application/json | ||
host: | ||
- test.openai.azure.com | ||
user-agent: | ||
- python-httpx/0.27.2 | ||
method: POST | ||
uri: https://test.openai.azure.com/openai/deployments/test-azure-deployment/chat/completions?api-version=2024-05-01-preview | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @michaelneale this is a scrubbed real request/response |
||
response: | ||
body: | ||
string: '{"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"finish_reason":"stop","index":0,"logprobs":null,"message":{"content":"Hello! | ||
How can I assist you today?","role":"assistant"}}],"created":1727230065,"id":"chatcmpl-ABBjN3AoYlxkP7Vg2lBvUhYeA6j5K","model":"gpt-4-32k","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":null,"usage":{"completion_tokens":9,"prompt_tokens":18,"total_tokens":27}} | ||
|
||
' | ||
headers: | ||
Cache-Control: | ||
- no-cache, must-revalidate | ||
Content-Length: | ||
- '825' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Wed, 25 Sep 2024 02:07:45 GMT | ||
Set-Cookie: test_set_cookie | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
access-control-allow-origin: | ||
- '*' | ||
apim-request-id: | ||
- 82e66ef8-ac07-4a43-b60f-9aecec1d8c81 | ||
azureml-model-session: | ||
- d145-20240919052126 | ||
openai-organization: test_openai_org_key | ||
x-accel-buffering: | ||
- 'no' | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-client-request-id: | ||
- 82e66ef8-ac07-4a43-b60f-9aecec1d8c81 | ||
x-ms-rai-invoked: | ||
- 'true' | ||
x-ms-region: | ||
- Switzerland North | ||
x-ratelimit-remaining-requests: | ||
- '79' | ||
x-ratelimit-remaining-tokens: | ||
- '79984' | ||
x-request-id: | ||
- 38db9001-8b16-4efe-84c9-620e10f18c3c | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
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,74 @@ | ||
interactions: | ||
- request: | ||
body: '{"messages": [{"role": "system", "content": "You are a helpful assistant. | ||
Expect to need to read a file using read_file."}, {"role": "user", "content": | ||
"What are the contents of this file? test.txt"}], "model": "gpt-4o-mini", "tools": | ||
[{"type": "function", "function": {"name": "read_file", "description": "Read | ||
the contents of the file.", "parameters": {"type": "object", "properties": {"filename": | ||
{"type": "string", "description": "The path to the file, which can be relative | ||
or\nabsolute. If it is a plain filename, it is assumed to be in the\ncurrent | ||
working directory."}}, "required": ["filename"]}}}]}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
api-key: | ||
- test_azure_api_key | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '608' | ||
content-type: | ||
- application/json | ||
host: | ||
- test.openai.azure.com | ||
user-agent: | ||
- python-httpx/0.27.2 | ||
method: POST | ||
uri: https://test.openai.azure.com/openai/deployments/test-azure-deployment/chat/completions?api-version=2024-05-01-preview | ||
response: | ||
body: | ||
string: '{"choices":[{"content_filter_results":{},"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\n \"filename\": | ||
\"test.txt\"\n}","name":"read_file"},"id":"call_a47abadDxlGKIWjvYYvGVAHa","type":"function"}]}}],"created":1727256650,"id":"chatcmpl-ABIeABbq5WVCq0e0AriGFaYDSih3P","model":"gpt-4-32k","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":null,"usage":{"completion_tokens":16,"prompt_tokens":109,"total_tokens":125}} | ||
|
||
' | ||
headers: | ||
Cache-Control: | ||
- no-cache, must-revalidate | ||
Content-Length: | ||
- '769' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Wed, 25 Sep 2024 09:30:50 GMT | ||
Set-Cookie: test_set_cookie | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
access-control-allow-origin: | ||
- '*' | ||
apim-request-id: | ||
- 8c0e3372-8ffd-4ff5-a5d1-0b962c4ea339 | ||
azureml-model-session: | ||
- d145-20240919052126 | ||
openai-organization: test_openai_org_key | ||
x-accel-buffering: | ||
- 'no' | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-client-request-id: | ||
- 8c0e3372-8ffd-4ff5-a5d1-0b962c4ea339 | ||
x-ms-rai-invoked: | ||
- 'true' | ||
x-ms-region: | ||
- Switzerland North | ||
x-ratelimit-remaining-requests: | ||
- '79' | ||
x-ratelimit-remaining-tokens: | ||
- '79824' | ||
x-request-id: | ||
- 401bd803-b790-47b7-b098-98708d44f060 | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baxen lemme know if you think this is more sensible than before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this looks good!