langroid 0.42.5__tar.gz → 0.42.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langroid-0.42.5 → langroid-0.42.7}/PKG-INFO +1 -1
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/azure_openai.py +13 -32
- {langroid-0.42.5 → langroid-0.42.7}/pyproject.toml +1 -1
- {langroid-0.42.5 → langroid-0.42.7}/.gitignore +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/LICENSE +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/README.md +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/base.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/batch.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/chat_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/chat_document.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/arangodb/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/arangodb/arangodb_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/arangodb/system_messages.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/arangodb/tools.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/arangodb/utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/neo4j/neo4j_chat_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/neo4j/system_messages.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/neo4j/tools.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/task.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tool_message.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/exa_search_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/file_tools.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/orchestration.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/rewind_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/tools/tavily_search_tool.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/agent/xml_tool_message.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/cachedb/base.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/base.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/models.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/exceptions.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/base.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/config.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/mock_lm.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/model_info.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/openai_gpt.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/mytypes.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/parser.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/pdf_utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/routing.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/search.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/spider.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/urls.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/parsing/web_search.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/prompts/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/prompts/dialog.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/prompts/templates.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/py.typed +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/pydantic_v1/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/pydantic_v1/main.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/configuration.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/constants.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/git_utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/globals.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/logging.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/object_registry.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/output/citations.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/output/printing.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/output/status.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/system.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/utils/types.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/base.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/pineconedb.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/postgres.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/qdrantdb.py +0 -0
- {langroid-0.42.5 → langroid-0.42.7}/langroid/vector_store/weaviatedb.py +0 -0
@@ -28,23 +28,23 @@ class AzureConfig(OpenAIGPTConfig):
|
|
28
28
|
type (str): should be ``azure.``
|
29
29
|
api_version (str): can be set in the ``.env`` file as
|
30
30
|
``AZURE_OPENAI_API_VERSION.``
|
31
|
-
deployment_name (str): can be set in the ``.env`` file as
|
31
|
+
deployment_name (str|None): can be optionally set in the ``.env`` file as
|
32
32
|
``AZURE_OPENAI_DEPLOYMENT_NAME`` and should be based the custom name you
|
33
33
|
chose for your deployment when you deployed a model.
|
34
|
-
model_name (str): can be set in the ``.env``
|
34
|
+
model_name (str): [DEPRECATED] can be set in the ``.env``
|
35
35
|
file as ``AZURE_OPENAI_MODEL_NAME``
|
36
36
|
and should be based on the model name chosen during setup.
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
chat_model (str): the chat model name to use. Can be set via
|
38
|
+
the env variable ``AZURE_OPENAI_CHAT_MODEL``.
|
39
|
+
Recommended to use this instead of ``model_name``.
|
40
|
+
|
40
41
|
"""
|
41
42
|
|
42
43
|
api_key: str = "" # CAUTION: set this ONLY via env var AZURE_OPENAI_API_KEY
|
43
44
|
type: str = "azure"
|
44
45
|
api_version: str = "2023-05-15"
|
45
|
-
deployment_name: str =
|
46
|
+
deployment_name: str | None = None
|
46
47
|
model_name: str = ""
|
47
|
-
model_version: str = "" # is used to determine the cost of using the model
|
48
48
|
api_base: str = ""
|
49
49
|
|
50
50
|
# Alternatively, bring your own clients:
|
@@ -59,18 +59,16 @@ class AzureConfig(OpenAIGPTConfig):
|
|
59
59
|
class Config:
|
60
60
|
env_prefix = "AZURE_OPENAI_"
|
61
61
|
|
62
|
+
def __init__(self, **kwargs) -> None: # type: ignore
|
63
|
+
if "model_name" in kwargs and "chat_model" not in kwargs:
|
64
|
+
kwargs["chat_model"] = kwargs["model_name"]
|
65
|
+
super().__init__(**kwargs)
|
66
|
+
|
62
67
|
|
63
68
|
class AzureGPT(OpenAIGPT):
|
64
69
|
"""
|
65
70
|
Class to access OpenAI LLMs via Azure. These env variables can be obtained from the
|
66
71
|
file `.azure_env`. Azure OpenAI doesn't support ``completion``
|
67
|
-
Attributes:
|
68
|
-
config (AzureConfig): AzureConfig object
|
69
|
-
api_key (str): Azure API key
|
70
|
-
api_base (str): Azure API base url
|
71
|
-
api_version (str): Azure API version
|
72
|
-
model_name (str): the name of gpt model in your deployment
|
73
|
-
model_version (str): the version of gpt model in your deployment
|
74
72
|
"""
|
75
73
|
|
76
74
|
def __init__(self, config: AzureConfig):
|
@@ -78,20 +76,6 @@ class AzureGPT(OpenAIGPT):
|
|
78
76
|
load_dotenv()
|
79
77
|
super().__init__(config)
|
80
78
|
self.config: AzureConfig = config
|
81
|
-
if self.config.deployment_name == "":
|
82
|
-
raise ValueError(
|
83
|
-
"""
|
84
|
-
AZURE_OPENAI_DEPLOYMENT_NAME not set in .env file,
|
85
|
-
please set it to your Azure openai deployment name."""
|
86
|
-
)
|
87
|
-
self.deployment_name = self.config.deployment_name
|
88
|
-
|
89
|
-
if self.config.model_name == "":
|
90
|
-
raise ValueError(
|
91
|
-
"""
|
92
|
-
AZURE_OPENAI_MODEL_NAME not set in .env file,
|
93
|
-
please set it to chat model name in your deployment."""
|
94
|
-
)
|
95
79
|
|
96
80
|
if (
|
97
81
|
self.config.azure_openai_client_provider
|
@@ -144,10 +128,7 @@ class AzureGPT(OpenAIGPT):
|
|
144
128
|
timeout=Timeout(self.config.timeout),
|
145
129
|
)
|
146
130
|
|
147
|
-
# set the chat model to be the same as the model_name
|
148
|
-
self.config.chat_model = self.config.model_name
|
149
|
-
|
150
131
|
self.supports_json_schema = (
|
151
132
|
self.config.api_version >= azureStructuredOutputAPIMin
|
152
|
-
and self.config.
|
133
|
+
and self.config.api_version in azureStructuredOutputList
|
153
134
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.42.5 → langroid-0.42.7}/langroid/agent/special/sql/utils/description_extractors.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.42.5 → langroid-0.42.7}/langroid/language_models/prompt_formatter/llama2_formatter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|