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

File caching #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lauren1066
Copy link
Contributor

No description provided.

@Lauren1066 Lauren1066 linked an issue Jun 11, 2024 that may be closed by this pull request
@Lauren1066 Lauren1066 self-assigned this Jun 11, 2024
@Lauren1066 Lauren1066 requested a review from dahifi June 11, 2024 15:13
Copy link
Member

@dahifi dahifi left a comment

Choose a reason for hiding this comment

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

Test fails.
Fix the env import.
Rename integration test or mock API calls

async def test_cache(self):
adapter = OpenAIAdapter(message_with_citation)
await adapter.main()
self.assertIn("file-A8iZLTqbU5cxrNOWfe4gd404", adapter.files_cache)
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work, unless you have the same key. Use TEST_FILE_ID in the env.

Update line 11: load_dotenv('../.env', override=True).

@@ -88,3 +88,8 @@ def test_has_annotations(self):

result = OpenAIAdapter(message_with_citation).has_annotations()
self.assertTrue(result)

async def test_cache(self):
Copy link
Member

Choose a reason for hiding this comment

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

Tests that aren't mocked should be named test_cache_integration. otherwise mock the API client call. See test_on_chat_resume_logic for a way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache files retrieval call in annotations.set_citations
2 participants