langroid 0.16.0__py3-none-any.whl → 0.16.1__py3-none-any.whl
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/language_models/openai_gpt.py +19 -3
- {langroid-0.16.0.dist-info → langroid-0.16.1.dist-info}/METADATA +6 -1
- {langroid-0.16.0.dist-info → langroid-0.16.1.dist-info}/RECORD +6 -6
- pyproject.toml +1 -1
- {langroid-0.16.0.dist-info → langroid-0.16.1.dist-info}/LICENSE +0 -0
- {langroid-0.16.0.dist-info → langroid-0.16.1.dist-info}/WHEEL +0 -0
@@ -606,6 +606,17 @@ class OpenAIGPT(LanguageModel):
|
|
606
606
|
case _:
|
607
607
|
return []
|
608
608
|
|
609
|
+
def rename_params(self) -> Dict[str, str]:
|
610
|
+
"""
|
611
|
+
Map of param name -> new name for specific models.
|
612
|
+
Currently main troublemaker is o1* series.
|
613
|
+
"""
|
614
|
+
match self.config.chat_model:
|
615
|
+
case OpenAIChatModel.O1_MINI | OpenAIChatModel.O1_PREVIEW:
|
616
|
+
return {"max_tokens": "max_completion_tokens"}
|
617
|
+
case _:
|
618
|
+
return {}
|
619
|
+
|
609
620
|
def chat_context_length(self) -> int:
|
610
621
|
"""
|
611
622
|
Context-length for chat-completion models/endpoints
|
@@ -1186,7 +1197,7 @@ class OpenAIGPT(LanguageModel):
|
|
1186
1197
|
kwargs["prompt"] = prompt
|
1187
1198
|
args = dict(
|
1188
1199
|
**kwargs,
|
1189
|
-
|
1200
|
+
max_tokens=max_tokens, # for output/completion
|
1190
1201
|
stream=self.get_stream(),
|
1191
1202
|
)
|
1192
1203
|
args = self._openai_api_call_params(args)
|
@@ -1261,7 +1272,7 @@ class OpenAIGPT(LanguageModel):
|
|
1261
1272
|
kwargs["prompt"] = prompt
|
1262
1273
|
cached, hashed_key, response = await completions_with_backoff(
|
1263
1274
|
**kwargs,
|
1264
|
-
|
1275
|
+
max_tokens=max_tokens,
|
1265
1276
|
stream=False,
|
1266
1277
|
)
|
1267
1278
|
if not isinstance(response, dict):
|
@@ -1468,7 +1479,7 @@ class OpenAIGPT(LanguageModel):
|
|
1468
1479
|
args: Dict[str, Any] = dict(
|
1469
1480
|
model=chat_model,
|
1470
1481
|
messages=[m.api_dict() for m in llm_messages],
|
1471
|
-
|
1482
|
+
max_tokens=max_tokens,
|
1472
1483
|
stream=self.get_stream(),
|
1473
1484
|
)
|
1474
1485
|
args.update(self._openai_api_call_params(args))
|
@@ -1498,6 +1509,11 @@ class OpenAIGPT(LanguageModel):
|
|
1498
1509
|
# some models e.g. o1-mini (as of sep 2024) don't support some params,
|
1499
1510
|
# like temperature and stream, so we need to remove them.
|
1500
1511
|
args.pop(p, None)
|
1512
|
+
|
1513
|
+
param_rename_map = self.rename_params()
|
1514
|
+
for old_param, new_param in param_rename_map.items():
|
1515
|
+
if old_param in args:
|
1516
|
+
args[new_param] = args.pop(old_param)
|
1501
1517
|
return args
|
1502
1518
|
|
1503
1519
|
def _process_chat_completion_response(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: langroid
|
3
|
-
Version: 0.16.
|
3
|
+
Version: 0.16.1
|
4
4
|
Summary: Harness LLMs with Multi-Agent Programming
|
5
5
|
License: MIT
|
6
6
|
Author: Prasad Chalasani
|
@@ -242,6 +242,11 @@ teacher_task.run()
|
|
242
242
|
<details>
|
243
243
|
<summary> <b>Click to expand</b></summary>
|
244
244
|
|
245
|
+
- **Sep 2024:**
|
246
|
+
- **[0.16.0](https://github.com/langroid/langroid/releases/tag/0.16.0)** Support for OpenAI `o1-mini` and `o1-preview` models.
|
247
|
+
- **[0.15.0](https://github.com/langroid/langroid/releases/tag/0.15.0)** Cerebras API support -- run llama-3.1 models hosted on Cerebras Cloud (very fast inference).
|
248
|
+
- **[0.14.0](https://github.com/langroid/langroid/releases/tag/0.14.0)** `DocChatAgent` uses Reciprocal Rank Fusion (RRF) to rank chunks retrieved by different methods.
|
249
|
+
- **[0.12.0](https://github.com/langroid/langroid/releases/tag/0.12.0)** `run_batch_task` new option -- `stop_on_first_result` - allows termination of batch as soon as any task returns a result.
|
245
250
|
- **Aug 2024:**
|
246
251
|
- **[0.11.0](https://github.com/langroid/langroid/releases/tag/0.11.0)** Polymorphic `Task.run(), Task.run_async`.
|
247
252
|
- **[0.10.0](https://github.com/langroid/langroid/releases/tag/0.10.0)** Allow tool handlers to return arbitrary result type, including other tools.
|
@@ -72,7 +72,7 @@ langroid/language_models/azure_openai.py,sha256=G4le3j4YLHV7IwgB2C37hO3MKijZ1Kjy
|
|
72
72
|
langroid/language_models/base.py,sha256=ytJ_0Jw5erbqrqLPp4JMCo_nIkwzUvBqoKUr8Sae9Qg,21792
|
73
73
|
langroid/language_models/config.py,sha256=9Q8wk5a7RQr8LGMT_0WkpjY8S4ywK06SalVRjXlfCiI,378
|
74
74
|
langroid/language_models/mock_lm.py,sha256=HuiAvjHiCfffYF5xjFJUq945HVTW0QPbeUUctOnNCzQ,3868
|
75
|
-
langroid/language_models/openai_gpt.py,sha256=
|
75
|
+
langroid/language_models/openai_gpt.py,sha256=rZJCX1hJHPvlL8mR5ec3TUyG2nwFTZH4UifnE7wrWD4,64111
|
76
76
|
langroid/language_models/prompt_formatter/__init__.py,sha256=2-5cdE24XoFDhifOLl8yiscohil1ogbP1ECkYdBlBsk,372
|
77
77
|
langroid/language_models/prompt_formatter/base.py,sha256=eDS1sgRNZVnoajwV_ZIha6cba5Dt8xjgzdRbPITwx3Q,1221
|
78
78
|
langroid/language_models/prompt_formatter/hf_formatter.py,sha256=PVJppmjRvD-2DF-XNC6mE05vTZ9wbu37SmXwZBQhad0,5055
|
@@ -138,8 +138,8 @@ langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3Hmh
|
|
138
138
|
langroid/vector_store/momento.py,sha256=qR-zBF1RKVHQZPZQYW_7g-XpTwr46p8HJuYPCkfJbM4,10534
|
139
139
|
langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
|
140
140
|
langroid/vector_store/qdrantdb.py,sha256=v88lqFkepADvlN6lByUj9I4NEKa9X9lWH16uTPPbYrE,17457
|
141
|
-
pyproject.toml,sha256=
|
142
|
-
langroid-0.16.
|
143
|
-
langroid-0.16.
|
144
|
-
langroid-0.16.
|
145
|
-
langroid-0.16.
|
141
|
+
pyproject.toml,sha256=HDI-JAyZ243qlEJ5tk58A02rIuiPzsy_PFdrgYzWPT4,7157
|
142
|
+
langroid-0.16.1.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
143
|
+
langroid-0.16.1.dist-info/METADATA,sha256=TC5RuK81GFIJC6X-RW8TBXbyDMU8OBEAgcxqQ8wxhSE,56165
|
144
|
+
langroid-0.16.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
145
|
+
langroid-0.16.1.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|