feat: add cloudflare workers ai embeddings
This change adds support for Cloudflare Workers AI Embeddings.
References:
- https://python.langchain.com/docs/integrations/text_embedding/cloudflare_workersai/
- https://developers.cloudflare.com/workers-ai/models/#text-embeddings
Signed-off-by: Siavash Safi [email protected]
This pull request is automatically being deployed by Amplify Hosting (learn more).
Access this pull request here: https://pr-3697.dmtpw4p5recq1.amplifyapp.com
hey @siavashs
Sorry for the taking so long to review this. Are there other CloudFlare Workers components you want to add?
CodSpeed Performance Report
Merging #3697 will improve performances by ×9.9
Comparing siavashs:feat/cloudflare-workers-ai-embeddings (7ebe360) with main (0f5c31f)
Summary
⚡ 3 improvements
✅ 12 untouched benchmarks
Benchmarks breakdown
| Benchmark | main |
siavashs:feat/cloudflare-workers-ai-embeddings |
Change | |
|---|---|---|---|---|
| ⚡ | test_get_all |
5,192.8 ms | 523.8 ms | ×9.9 |
| ⚡ | test_successful_run_with_input_type_any |
205.3 ms | 129.6 ms | +58.43% |
| ⚡ | test_successful_run_with_input_type_text |
172.3 ms | 127.4 ms | +35.33% |
Hey @ogabrielluiz no problem. I'm considering to add chat support too https://python.langchain.com/docs/integrations/chat/cloudflare_workersai/ I can add it to the same PR and also fix the merge conflicts.
Hitting a dependency conflict with langchain-community>=0.3.6 on sqlalchemy so I guess that needs to be sorted out first.
We can merge this PR as is.