From 951384284d9c3e622ec68c9d7fcefe75a556c6e1 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 26 Feb 2024 10:45:50 -0300 Subject: [PATCH] Refactor AzureChatOpenAI components and update documentation links --- .../model_specs/AzureChatOpenAISpecs.py | 10 ++++--- .../components/models/AzureOpenAIModel.py | 6 +++-- src/backend/langflow/config.yaml | 26 ------------------- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/src/backend/langflow/components/model_specs/AzureChatOpenAISpecs.py b/src/backend/langflow/components/model_specs/AzureChatOpenAISpecs.py index d43abb3dc..a55760006 100644 --- a/src/backend/langflow/components/model_specs/AzureChatOpenAISpecs.py +++ b/src/backend/langflow/components/model_specs/AzureChatOpenAISpecs.py @@ -1,13 +1,17 @@ from typing import Optional -from langflow import CustomComponent + from langchain.llms.base import BaseLanguageModel from langchain_community.chat_models.azure_openai import AzureChatOpenAI +from langflow import CustomComponent -class AzureChatOpenAIComponent(CustomComponent): + +class AzureChatOpenAISpecsComponent(CustomComponent): display_name: str = "AzureChatOpenAI" description: str = "LLM model from Azure OpenAI." - documentation: str = "https://python.langchain.com/docs/integrations/llms/azure_openai" + documentation: str = ( + "https://python.langchain.com/docs/integrations/llms/azure_openai" + ) beta = False AZURE_OPENAI_MODELS = [ diff --git a/src/backend/langflow/components/models/AzureOpenAIModel.py b/src/backend/langflow/components/models/AzureOpenAIModel.py index 06fbd444d..23da7e2ea 100644 --- a/src/backend/langflow/components/models/AzureOpenAIModel.py +++ b/src/backend/langflow/components/models/AzureOpenAIModel.py @@ -7,9 +7,11 @@ from langflow import CustomComponent class AzureChatOpenAIComponent(CustomComponent): - display_name: str = "AzureOpenAIModel" + display_name: str = "AzureOpenAI Model" description: str = "Generate text using LLM model from Azure OpenAI." - documentation: str = "https://python.langchain.com/docs/integrations/llms/azure_openai" + documentation: str = ( + "https://python.langchain.com/docs/integrations/llms/azure_openai" + ) beta = False AZURE_OPENAI_MODELS = [ diff --git a/src/backend/langflow/config.yaml b/src/backend/langflow/config.yaml index 5ec4f3aaa..85ac1785d 100644 --- a/src/backend/langflow/config.yaml +++ b/src/backend/langflow/config.yaml @@ -109,32 +109,6 @@ embeddings: OllamaEmbeddings: documentation: "https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/ollama" -llms: - OpenAI: - documentation: "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/openai" - ChatOpenAI: - documentation: "https://python.langchain.com/docs/modules/model_io/models/chat/integrations/openai" - LlamaCpp: - documentation: "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/llamacpp" - CTransformers: - documentation: "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/ctransformers" - Cohere: - documentation: "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/cohere" - Anthropic: - documentation: "" - ChatAnthropic: - documentation: "https://python.langchain.com/docs/modules/model_io/models/chat/integrations/anthropic" - HuggingFaceHub: - documentation: "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/huggingface_hub" - VertexAI: - documentation: "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/google_vertex_ai_palm" - ### - # There's a bug in this component deactivating until we get it sorted: _language_models.py", line 804, in send_message - # is_blocked=safety_attributes.get("blocked", False), - # AttributeError: 'list' object has no attribute 'get' - ChatVertexAI: - documentation: "https://python.langchain.com/docs/modules/model_io/models/chat/integrations/google_vertex_ai_palm" - ### memories: # https://github.com/supabase-community/supabase-py/issues/482 # ZepChatMessageHistory: