langflow icon indicating copy to clipboard operation
langflow copied to clipboard

feat: add cloudflare workers ai embeddings

Open siavashs opened this issue 1 year ago • 5 comments

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]

siavashs avatar Sep 05 '24 14:09 siavashs

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?

ogabrielluiz avatar Nov 14 '24 10:11 ogabrielluiz

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%

codspeed-hq[bot] avatar Nov 14 '24 10:11 codspeed-hq[bot]

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.

siavashs avatar Nov 14 '24 11:11 siavashs

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.

siavashs avatar Nov 14 '24 14:11 siavashs