langroid 0.15.1__tar.gz → 0.16.0__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.15.1 → langroid-0.16.0}/PKG-INFO +2 -2
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/neo4j/neo4j_chat_agent.py +6 -1
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/openai_gpt.py +45 -4
- {langroid-0.15.1 → langroid-0.16.0}/pyproject.toml +2 -2
- {langroid-0.15.1 → langroid-0.16.0}/LICENSE +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/README.md +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/base.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/batch.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/callbacks/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/callbacks/chainlit.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/chat_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/chat_document.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/helpers.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/junk +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/openai_assistant.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/doc_chat_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/lance_doc_chat_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/lance_rag/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/lance_rag/critic_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/lance_rag/lance_rag_task.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/lance_rag/query_planner_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/lance_tools.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/neo4j/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/neo4j/csv_kg_chat.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/neo4j/utils/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/neo4j/utils/system_message.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/relevance_extractor_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/retriever_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/sql_chat_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/utils/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/utils/description_extractors.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/utils/populate_metadata.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/utils/system_message.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/sql/utils/tools.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/special/table_chat_agent.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/structured_message.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/task.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tool_message.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/duckduckgo_search_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/extract_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/generator_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/google_search_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/metaphor_search_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/note_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/orchestration.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/recipient_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/retrieval_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/rewind_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/run_python_code.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/tools/segment_extract_tool.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent/typed_task.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/agent_config.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/cachedb/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/cachedb/base.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/cachedb/momento_cachedb.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/cachedb/redis_cachedb.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/base.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/clustering.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/models.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/protoc/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/protoc/embeddings.proto +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/protoc/embeddings_pb2.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/protoc/embeddings_pb2.pyi +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/protoc/embeddings_pb2_grpc.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/embedding_models/remote_embeds.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/exceptions.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/.chainlit/config.toml +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/.chainlit/translations/en-US.json +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/azure_openai.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/base.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/config.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/mock_lm.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/prompt_formatter/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/prompt_formatter/base.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/prompt_formatter/hf_formatter.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/prompt_formatter/llama2_formatter.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/utils.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/mytypes.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/agent_chats.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/code-parsing.md +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/code_parser.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/config.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/document_parser.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/image_text.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/para_sentence_split.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/parse_json.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/parser.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/repo_loader.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/routing.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/search.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/spider.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/table_loader.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/url_loader.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/url_loader_cookies.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/urls.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/utils.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/parsing/web_search.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/prompts/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/prompts/chat-gpt4-system-prompt.md +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/prompts/dialog.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/prompts/prompts_config.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/prompts/templates.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/py.typed +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/pydantic_v1/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/pydantic_v1/main.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/.chainlit/config.toml +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/.chainlit/translations/en-US.json +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/algorithms/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/algorithms/graph.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/configuration.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/constants.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/docker.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/globals.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/llms/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/llms/strings.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/logging.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/object_registry.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/output/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/output/citations.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/output/printing.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/output/status.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/pandas_utils.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/pydantic_utils.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/system.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/types.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/web/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/utils/web/login.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/__init__.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/base.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/chromadb.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/lancedb.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/meilisearch.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/momento.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/qdrant_cloud.py +0 -0
- {langroid-0.15.1 → langroid-0.16.0}/langroid/vector_store/qdrantdb.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: langroid
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.16.0
|
4
4
|
Summary: Harness LLMs with Multi-Agent Programming
|
5
5
|
License: MIT
|
6
6
|
Author: Prasad Chalasani
|
@@ -66,7 +66,7 @@ Requires-Dist: neo4j (>=5.14.1,<6.0.0) ; extra == "all" or extra == "neo4j"
|
|
66
66
|
Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
|
67
67
|
Requires-Dist: nltk (>=3.8.1,<4.0.0)
|
68
68
|
Requires-Dist: onnxruntime (>=1.16.1,<2.0.0)
|
69
|
-
Requires-Dist: openai (>=1.
|
69
|
+
Requires-Dist: openai (>=1.45.0,<2.0.0)
|
70
70
|
Requires-Dist: pandas (>=2.0.3,<3.0.0)
|
71
71
|
Requires-Dist: pdf2image (>=1.17.0,<2.0.0) ; extra == "doc-chat" or extra == "all" or extra == "pdf-parsers"
|
72
72
|
Requires-Dist: pdfplumber (>=0.10.2,<0.11.0) ; extra == "doc-chat" or extra == "all" or extra == "pdf-parsers"
|
@@ -91,6 +91,11 @@ class Neo4jChatAgent(ChatAgent):
|
|
91
91
|
self._import_neo4j()
|
92
92
|
self._initialize_connection()
|
93
93
|
self._init_tool_messages()
|
94
|
+
self.init_state()
|
95
|
+
|
96
|
+
def init_state(self) -> None:
|
97
|
+
super().init_state()
|
98
|
+
self.current_retrieval_cypher_query: str = ""
|
94
99
|
|
95
100
|
def handle_message_fallback(
|
96
101
|
self, msg: str | ChatDocument
|
@@ -274,7 +279,7 @@ class Neo4jChatAgent(ChatAgent):
|
|
274
279
|
the database.
|
275
280
|
"""
|
276
281
|
query = msg.cypher_query
|
277
|
-
|
282
|
+
self.current_retrieval_cypher_query = query
|
278
283
|
logger.info(f"Executing Cypher query: {query}")
|
279
284
|
response = self.read_query(query)
|
280
285
|
if isinstance(response.data, list) and len(response.data) == 0:
|
@@ -88,6 +88,8 @@ class OpenAIChatModel(str, Enum):
|
|
88
88
|
GPT4_TURBO = "gpt-4-turbo"
|
89
89
|
GPT4o = "gpt-4o-2024-08-06"
|
90
90
|
GPT4o_MINI = "gpt-4o-mini"
|
91
|
+
O1_PREVIEW = "o1-preview"
|
92
|
+
O1_MINI = "o1-mini"
|
91
93
|
|
92
94
|
|
93
95
|
class OpenAICompletionModel(str, Enum):
|
@@ -105,6 +107,8 @@ _context_length: Dict[str, int] = {
|
|
105
107
|
OpenAIChatModel.GPT4_TURBO: 128_000,
|
106
108
|
OpenAIChatModel.GPT4o: 128_000,
|
107
109
|
OpenAIChatModel.GPT4o_MINI: 128_000,
|
110
|
+
OpenAIChatModel.O1_PREVIEW: 128_000,
|
111
|
+
OpenAIChatModel.O1_MINI: 128_000,
|
108
112
|
OpenAICompletionModel.TEXT_DA_VINCI_003: 4096,
|
109
113
|
AnthropicModel.CLAUDE_3_5_SONNET: 200_000,
|
110
114
|
AnthropicModel.CLAUDE_3_OPUS: 200_000,
|
@@ -120,6 +124,8 @@ _cost_per_1k_tokens: Dict[str, Tuple[float, float]] = {
|
|
120
124
|
OpenAIChatModel.GPT4_TURBO: (0.01, 0.03), # 128K context
|
121
125
|
OpenAIChatModel.GPT4o: (0.0025, 0.010), # 128K context
|
122
126
|
OpenAIChatModel.GPT4o_MINI: (0.00015, 0.0006), # 128K context
|
127
|
+
OpenAIChatModel.O1_PREVIEW: (0.015, 0.060), # 128K context
|
128
|
+
OpenAIChatModel.O1_MINI: (0.003, 0.012), # 128K context
|
123
129
|
AnthropicModel.CLAUDE_3_5_SONNET: (0.003, 0.015),
|
124
130
|
AnthropicModel.CLAUDE_3_OPUS: (0.015, 0.075),
|
125
131
|
AnthropicModel.CLAUDE_3_SONNET: (0.003, 0.015),
|
@@ -132,6 +138,8 @@ openAIChatModelPreferenceList = [
|
|
132
138
|
OpenAIChatModel.GPT4_TURBO,
|
133
139
|
OpenAIChatModel.GPT4,
|
134
140
|
OpenAIChatModel.GPT4o_MINI,
|
141
|
+
OpenAIChatModel.O1_MINI,
|
142
|
+
OpenAIChatModel.O1_PREVIEW,
|
135
143
|
OpenAIChatModel.GPT3_5_TURBO,
|
136
144
|
]
|
137
145
|
|
@@ -140,6 +148,15 @@ openAICompletionModelPreferenceList = [
|
|
140
148
|
OpenAICompletionModel.TEXT_DA_VINCI_003,
|
141
149
|
]
|
142
150
|
|
151
|
+
NON_STREAMING_MODELS = [
|
152
|
+
OpenAIChatModel.O1_MINI,
|
153
|
+
OpenAIChatModel.O1_PREVIEW,
|
154
|
+
]
|
155
|
+
|
156
|
+
NON_SYSTEM_MESSAGE_MODELS = [
|
157
|
+
OpenAIChatModel.O1_MINI,
|
158
|
+
OpenAIChatModel.O1_PREVIEW,
|
159
|
+
]
|
143
160
|
|
144
161
|
if "OPENAI_API_KEY" in os.environ:
|
145
162
|
try:
|
@@ -579,6 +596,16 @@ class OpenAIGPT(LanguageModel):
|
|
579
596
|
openai_completion_models = [e.value for e in OpenAICompletionModel]
|
580
597
|
return self.config.completion_model in openai_completion_models
|
581
598
|
|
599
|
+
def unsupported_params(self) -> List[str]:
|
600
|
+
"""
|
601
|
+
List of params that are not supported by the current model
|
602
|
+
"""
|
603
|
+
match self.config.chat_model:
|
604
|
+
case OpenAIChatModel.O1_MINI | OpenAIChatModel.O1_PREVIEW:
|
605
|
+
return ["temperature", "stream"]
|
606
|
+
case _:
|
607
|
+
return []
|
608
|
+
|
582
609
|
def chat_context_length(self) -> int:
|
583
610
|
"""
|
584
611
|
Context-length for chat-completion models/endpoints
|
@@ -623,7 +650,11 @@ class OpenAIGPT(LanguageModel):
|
|
623
650
|
|
624
651
|
def get_stream(self) -> bool:
|
625
652
|
"""Get streaming status"""
|
626
|
-
return
|
653
|
+
return (
|
654
|
+
self.config.stream
|
655
|
+
and settings.stream
|
656
|
+
and self.config.chat_model not in NON_STREAMING_MODELS
|
657
|
+
)
|
627
658
|
|
628
659
|
@no_type_check
|
629
660
|
def _process_stream_event(
|
@@ -1155,7 +1186,7 @@ class OpenAIGPT(LanguageModel):
|
|
1155
1186
|
kwargs["prompt"] = prompt
|
1156
1187
|
args = dict(
|
1157
1188
|
**kwargs,
|
1158
|
-
|
1189
|
+
max_completion_tokens=max_tokens, # for output/completion
|
1159
1190
|
stream=self.get_stream(),
|
1160
1191
|
)
|
1161
1192
|
args = self._openai_api_call_params(args)
|
@@ -1230,7 +1261,7 @@ class OpenAIGPT(LanguageModel):
|
|
1230
1261
|
kwargs["prompt"] = prompt
|
1231
1262
|
cached, hashed_key, response = await completions_with_backoff(
|
1232
1263
|
**kwargs,
|
1233
|
-
|
1264
|
+
max_completion_tokens=max_tokens,
|
1234
1265
|
stream=False,
|
1235
1266
|
)
|
1236
1267
|
if not isinstance(response, dict):
|
@@ -1421,6 +1452,12 @@ class OpenAIGPT(LanguageModel):
|
|
1421
1452
|
else:
|
1422
1453
|
llm_messages = messages
|
1423
1454
|
|
1455
|
+
# for models that don't support system msg, change SYSTEM role to USER
|
1456
|
+
if self.config.chat_model in NON_SYSTEM_MESSAGE_MODELS:
|
1457
|
+
for i, m in enumerate(llm_messages):
|
1458
|
+
if m.role == Role.SYSTEM:
|
1459
|
+
llm_messages[i].role = Role.USER
|
1460
|
+
|
1424
1461
|
# Azure uses different parameters. It uses ``engine`` instead of ``model``
|
1425
1462
|
# and the value should be the deployment_name not ``self.config.chat_model``
|
1426
1463
|
chat_model = self.config.chat_model
|
@@ -1431,7 +1468,7 @@ class OpenAIGPT(LanguageModel):
|
|
1431
1468
|
args: Dict[str, Any] = dict(
|
1432
1469
|
model=chat_model,
|
1433
1470
|
messages=[m.api_dict() for m in llm_messages],
|
1434
|
-
|
1471
|
+
max_completion_tokens=max_tokens,
|
1435
1472
|
stream=self.get_stream(),
|
1436
1473
|
)
|
1437
1474
|
args.update(self._openai_api_call_params(args))
|
@@ -1457,6 +1494,10 @@ class OpenAIGPT(LanguageModel):
|
|
1457
1494
|
tool_choice=tool_choice,
|
1458
1495
|
)
|
1459
1496
|
)
|
1497
|
+
for p in self.unsupported_params():
|
1498
|
+
# some models e.g. o1-mini (as of sep 2024) don't support some params,
|
1499
|
+
# like temperature and stream, so we need to remove them.
|
1500
|
+
args.pop(p, None)
|
1460
1501
|
return args
|
1461
1502
|
|
1462
1503
|
def _process_chat_completion_response(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "langroid"
|
3
|
-
version = "0.
|
3
|
+
version = "0.16.0"
|
4
4
|
description = "Harness LLMs with Multi-Agent Programming"
|
5
5
|
authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
|
6
6
|
readme = "README.md"
|
@@ -53,7 +53,7 @@ trafilatura = "^1.5.0"
|
|
53
53
|
halo = "^0.0.31"
|
54
54
|
typer = "^0.9.0"
|
55
55
|
colorlog = "^6.7.0"
|
56
|
-
openai = "^1.
|
56
|
+
openai = "^1.45.0"
|
57
57
|
tiktoken = "^0.7.0"
|
58
58
|
pygithub = "^1.58.1"
|
59
59
|
pygments = "^2.15.1"
|
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.15.1 → langroid-0.16.0}/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
|
{langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/.chainlit/translations/en-US.json
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
|
{langroid-0.15.1 → langroid-0.16.0}/langroid/language_models/prompt_formatter/hf_formatter.py
RENAMED
File without changes
|
{langroid-0.15.1 → langroid-0.16.0}/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
|
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
|