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

fix: Google embeddings endpoint bug (#2416) #2417

Conversation

tarunkumark
Copy link
Contributor

@tarunkumark tarunkumark commented Feb 6, 2025

Please describe the purpose of this pull request.
This is a fix for the archival tools not working when using Google Gemini's embedding models - text-embedding-004 and embedding-001. Also fixed a few syntax errors in tests/test_base_function and tests/test_sdk_client that did not let me run pytest.

How to test
Command to run the test: poetry run pytest tests/test_google_embeddings
There are 3 test cases,

  • checks validity of the gemini api endpoint
  • an archival insert and retrieval for the text-embedding-004 embedding model
  • an archival insert and retrieval for the embedding-001 embedding model

Have you tested this PR?
Pytest

PS E:\projects\open_source\letta> poetry run pytest .\tests\test_google_embeddings.py
================================================= test session starts =================================================
platform win32 -- Python 3.11.0, pytest-8.3.4, pluggy-1.5.0
rootdir: E:\projects\open_source\letta\tests
configfile: pytest.ini
plugins: anyio-4.8.0, langsmith-0.3.6, asyncio-0.23.8, mock-3.14.0, order-1.3.0
asyncio: mode=Mode.AUTO
collected 3 items

tests\test_google_embeddings.py ... 
====================================== 3 passed, 14 warnings in 87.65s (0:01:27) ======================================

text-embedding-004 archival output
image

embedding-001 archival output
image

Related issues or PRs
This is a fix intended for this issue #2416)

Is your PR over 500 lines of code?
No, 194 additions and 4 deletions.

Additional context
Add any other context or screenshots about the PR here.

@sarahwooders sarahwooders merged commit 1e51cba into letta-ai:main Feb 11, 2025
5 of 6 checks passed
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.

2 participants