Skip to content
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

Upgraded OpenAI SDK Version #65

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pydantic==2.8.2
requests
openai == 1.24.0
openai == 1.55.3
12 changes: 9 additions & 3 deletions tests/unit/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def check_ds_created(ds, mock_post, url):
self._compare_ds(ds, example_ds)
args, kwargs = mock_post.call_args

assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY}
assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json'}
assert kwargs['json'] == example_ds.model_dump()
assert args[0] == url

Expand Down Expand Up @@ -142,14 +142,15 @@ def test_create_knowledge_bases(self, mock_post, mock_get):

args, kwargs = mock_post.call_args

assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY}
assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json'}

expected_create_request = {
'name': test_knowledge_base_config.name,
'description': test_knowledge_base_config.description,
'vector_store': {
'engine': test_vector_store_config.engine,
'connection_data': test_vector_store_config.connection_data
'connection_data': test_vector_store_config.connection_data,
'table': test_vector_store_config.table
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
'embedding_model': {
'provider': test_embedding_config.provider,
Expand Down Expand Up @@ -443,3 +444,8 @@ def openai_completion_f(messages, *args, **kwargs):
if question == chunk.content.lower():
success = True
assert success is True


if __name__ == '__main__':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is extra
tests should be run using pytest command

import pytest
pytest.main()