fix: refactor Ollama model fetching to use async and filter capabilities#10550
Conversation
Replaces synchronous requests for Ollama model fetching with asynchronous httpx calls and adds filtering to only include models with 'completion' capability. Updates the LanguageModelComponent to support async validation and fetching of Ollama models, improving reliability and accuracy of available model options.
Introduces several Notion-related components for Langflow, including AddContentToPage, NotionDatabaseProperties, NotionListPages, NotionPageContent, NotionPageCreator, NotionPageUpdate, and NotionSearch. Updates the component index to register these new tools, enabling Notion API interactions such as page creation, content retrieval, database property listing, and more.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/ollama_embeddings #10550 +/- ##
========================================================
Coverage ? 39.35%
========================================================
Files ? 1476
Lines ? 82224
Branches ? 8991
========================================================
Hits ? 32359
Misses ? 48959
Partials ? 906
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| async with httpx.AsyncClient() as client: | ||
| # Fetch available models | ||
| tags_response = await client.get(url=tags_url) | ||
| tags_response.raise_for_status() |
There was a problem hiding this comment.
it seems the AsyncClient is only used on the first line
There was a problem hiding this comment.
This is tricky when I moved it out of context
There was a problem hiding this comment.
get the .json() call in the context and it should work.
Refactored the LanguageModelComponent code in Basic Prompt Chaining.json to improve formatting and readability. No functional changes were made; only code style and structure were updated.
|
@ogabrielluiz I have usedd a bse function in both embedding and langauge model component |
Moves Ollama model fetching and URL validation logic from the LanguageModelComponent class to shared utility functions in model_utils. Updates references in starter project JSONs to use the new utility functions for improved code reuse and maintainability.
…ollama-models-loading
Adds logic to skip processing text content when message state is 'complete' in OpenAI response streaming, ensuring only content_blocks are processed for tool calls. Updates LCModelComponent to set state to 'partial' during streaming and only update the database with 'complete' state, without sending a new message event, as the frontend already has all streamed content.
882e26c to
0c2c01e
Compare
868fb78 to
895284f
Compare
2660ccd to
dd07a95
Compare
…API come with type of last complete message (#10558) (I'm going to force-push to get this in while the nightly is broken - this is needed for QA ASAP) * Changed embedding model to show api base when switching embedding models * fix: refactor Ollama model fetching to use async and filter capabilities (#10550) * Refactor Ollama model fetching to use async and filter capabilities Replaces synchronous requests for Ollama model fetching with asynchronous httpx calls and adds filtering to only include models with 'completion' capability. Updates the LanguageModelComponent to support async validation and fetching of Ollama models, improving reliability and accuracy of available model options. * Update language_model.py * Add Notion integration components Introduces several Notion-related components for Langflow, including AddContentToPage, NotionDatabaseProperties, NotionListPages, NotionPageContent, NotionPageCreator, NotionPageUpdate, and NotionSearch. Updates the component index to register these new tools, enabling Notion API interactions such as page creation, content retrieval, database property listing, and more. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * Update LanguageModelComponent code in starter projects Refactored the LanguageModelComponent code in Basic Prompt Chaining.json to improve formatting and readability. No functional changes were made; only code style and structure were updated. * Refactor Ollama model fetching logic Moves Ollama model fetching and URL validation logic from the LanguageModelComponent class to shared utility functions in model_utils. Updates references in starter project JSONs to use the new utility functions for improved code reuse and maintainability. * Update component_index.json * Update Nvidia Remix.json * Handle message state for streaming responses Adds logic to skip processing text content when message state is 'complete' in OpenAI response streaming, ensuring only content_blocks are processed for tool calls. Updates LCModelComponent to set state to 'partial' during streaming and only update the database with 'complete' state, without sending a new message event, as the frontend already has all streamed content. * fixed test * Changed embedding model component * removed default values * fixed ruff * fixed starter projects --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com> * fixed backend test * fixed llm test * fixed update build config ollama test * fixed test embedding model component --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Replaces synchronous requests for Ollama model fetching with asynchronous httpx calls and adds filtering to only include models with 'completion' capability. Updates the LanguageModelComponent to support async validation and fetching of Ollama models, improving reliability and accuracy of available model options.