langroid 0.14.0__py3-none-any.whl → 0.15.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 +18 -6
- langroid/py.typed +0 -0
- {langroid-0.14.0.dist-info → langroid-0.15.1.dist-info}/METADATA +2 -1
- {langroid-0.14.0.dist-info → langroid-0.15.1.dist-info}/RECORD +7 -6
- pyproject.toml +3 -3
- {langroid-0.14.0.dist-info → langroid-0.15.1.dist-info}/LICENSE +0 -0
- {langroid-0.14.0.dist-info → langroid-0.15.1.dist-info}/WHEEL +0 -0
@@ -21,6 +21,7 @@ from typing import (
|
|
21
21
|
)
|
22
22
|
|
23
23
|
import openai
|
24
|
+
from cerebras.cloud.sdk import AsyncCerebras, Cerebras
|
24
25
|
from groq import AsyncGroq, Groq
|
25
26
|
from httpx import Timeout
|
26
27
|
from openai import AsyncOpenAI, OpenAI
|
@@ -371,8 +372,8 @@ class OpenAIGPT(LanguageModel):
|
|
371
372
|
Class for OpenAI LLMs
|
372
373
|
"""
|
373
374
|
|
374
|
-
client: OpenAI | Groq
|
375
|
-
async_client: AsyncOpenAI | AsyncGroq
|
375
|
+
client: OpenAI | Groq | Cerebras
|
376
|
+
async_client: AsyncOpenAI | AsyncGroq | AsyncCerebras
|
376
377
|
|
377
378
|
def __init__(self, config: OpenAIGPTConfig = OpenAIGPTConfig()):
|
378
379
|
"""
|
@@ -479,6 +480,7 @@ class OpenAIGPT(LanguageModel):
|
|
479
480
|
self.api_key = DUMMY_API_KEY
|
480
481
|
|
481
482
|
self.is_groq = self.config.chat_model.startswith("groq/")
|
483
|
+
self.is_cerebras = self.config.chat_model.startswith("cerebras/")
|
482
484
|
|
483
485
|
if self.is_groq:
|
484
486
|
self.config.chat_model = self.config.chat_model.replace("groq/", "")
|
@@ -489,6 +491,16 @@ class OpenAIGPT(LanguageModel):
|
|
489
491
|
self.async_client = AsyncGroq(
|
490
492
|
api_key=self.api_key,
|
491
493
|
)
|
494
|
+
elif self.is_cerebras:
|
495
|
+
self.config.chat_model = self.config.chat_model.replace("cerebras/", "")
|
496
|
+
self.api_key = os.getenv("CEREBRAS_API_KEY", DUMMY_API_KEY)
|
497
|
+
self.client = Cerebras(
|
498
|
+
api_key=self.api_key,
|
499
|
+
)
|
500
|
+
# TODO there is not async client, so should we do anything here?
|
501
|
+
self.async_client = AsyncCerebras(
|
502
|
+
api_key=self.api_key,
|
503
|
+
)
|
492
504
|
else:
|
493
505
|
self.client = OpenAI(
|
494
506
|
api_key=self.api_key,
|
@@ -1096,8 +1108,8 @@ class OpenAIGPT(LanguageModel):
|
|
1096
1108
|
if self.config.use_chat_for_completion:
|
1097
1109
|
return self.chat(messages=prompt, max_tokens=max_tokens)
|
1098
1110
|
|
1099
|
-
if self.is_groq:
|
1100
|
-
raise ValueError("Groq
|
1111
|
+
if self.is_groq or self.is_cerebras:
|
1112
|
+
raise ValueError("Groq, Cerebras do not support pure completions")
|
1101
1113
|
|
1102
1114
|
if settings.debug:
|
1103
1115
|
print(f"[grey37]PROMPT: {escape(prompt)}[/grey37]")
|
@@ -1174,8 +1186,8 @@ class OpenAIGPT(LanguageModel):
|
|
1174
1186
|
if self.config.use_chat_for_completion:
|
1175
1187
|
return await self.achat(messages=prompt, max_tokens=max_tokens)
|
1176
1188
|
|
1177
|
-
if self.is_groq:
|
1178
|
-
raise ValueError("Groq
|
1189
|
+
if self.is_groq or self.is_cerebras:
|
1190
|
+
raise ValueError("Groq, Cerebras do not support pure completions")
|
1179
1191
|
|
1180
1192
|
if settings.debug:
|
1181
1193
|
print(f"[grey37]PROMPT: {escape(prompt)}[/grey37]")
|
langroid/py.typed
ADDED
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: langroid
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.15.1
|
4
4
|
Summary: Harness LLMs with Multi-Agent Programming
|
5
5
|
License: MIT
|
6
6
|
Author: Prasad Chalasani
|
@@ -38,6 +38,7 @@ Provides-Extra: vecdbs
|
|
38
38
|
Requires-Dist: aiohttp (>=3.9.1,<4.0.0)
|
39
39
|
Requires-Dist: async-generator (>=1.10,<2.0)
|
40
40
|
Requires-Dist: bs4 (>=0.0.1,<0.0.2)
|
41
|
+
Requires-Dist: cerebras-cloud-sdk (>=1.1.0,<2.0.0)
|
41
42
|
Requires-Dist: chainlit (==1.1.202) ; extra == "all" or extra == "chainlit"
|
42
43
|
Requires-Dist: chromadb (>=0.4.21,<=0.4.23) ; extra == "vecdbs" or extra == "all" or extra == "chromadb"
|
43
44
|
Requires-Dist: colorlog (>=6.7.0,<7.0.0)
|
@@ -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=1wG1nXho6bLOWyWqlR51uY45ZFkt5NWXx0hbXzKLVoQ,62050
|
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
|
@@ -104,6 +104,7 @@ langroid/prompts/chat-gpt4-system-prompt.md,sha256=Q3uLCJTPQvmUkZN2XDnkBC7M2K3X0
|
|
104
104
|
langroid/prompts/dialog.py,sha256=SpfiSyofSgy2pwD1YboHR_yHO3LEEMbv6j2sm874jKo,331
|
105
105
|
langroid/prompts/prompts_config.py,sha256=p_lp9nbMuQwhhMwAZsOxveRw9C0ZFZvql7pdIfgVZYo,143
|
106
106
|
langroid/prompts/templates.py,sha256=kz0rPiM6iLGhhpDonF3Y87OznSe9FRI6A0pHU0wgW4Q,6314
|
107
|
+
langroid/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
107
108
|
langroid/pydantic_v1/__init__.py,sha256=HxPGVERapVueRUORgSpj2JX_vTZxVlVbWvhpQlpjygE,283
|
108
109
|
langroid/pydantic_v1/main.py,sha256=p_k7kDY9eDrsA5dxNNqXusKLgx7mS_icGnS7fu4goqY,147
|
109
110
|
langroid/utils/.chainlit/config.toml,sha256=1t5lHORGzc2E6dkaO9P15jYHu2w-4Kl9pYjpDPc84vs,3716
|
@@ -137,8 +138,8 @@ langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3Hmh
|
|
137
138
|
langroid/vector_store/momento.py,sha256=qR-zBF1RKVHQZPZQYW_7g-XpTwr46p8HJuYPCkfJbM4,10534
|
138
139
|
langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
|
139
140
|
langroid/vector_store/qdrantdb.py,sha256=v88lqFkepADvlN6lByUj9I4NEKa9X9lWH16uTPPbYrE,17457
|
140
|
-
pyproject.toml,sha256=
|
141
|
-
langroid-0.
|
142
|
-
langroid-0.
|
143
|
-
langroid-0.
|
144
|
-
langroid-0.
|
141
|
+
pyproject.toml,sha256=EmO_cGZJ6AE7pBXqiTbPdulXqp-s0Rx--XOJ7Ugs_DE,7157
|
142
|
+
langroid-0.15.1.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
143
|
+
langroid-0.15.1.dist-info/METADATA,sha256=vQAwZcIVIj0NS49-gFoxsBWS_MDZdi8ezYs1eeBKBwM,55481
|
144
|
+
langroid-0.15.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
145
|
+
langroid-0.15.1.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "langroid"
|
3
|
-
version = "0.
|
3
|
+
version = "0.15.1"
|
4
4
|
description = "Harness LLMs with Multi-Agent Programming"
|
5
5
|
authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
|
6
6
|
readme = "README.md"
|
7
7
|
license = "MIT"
|
8
|
-
include = ["pyproject.toml"]
|
9
|
-
|
8
|
+
include = ["pyproject.toml", "langroid/py.typed"]
|
10
9
|
|
11
10
|
# =============== MAIN DEPS ==============
|
12
11
|
[tool.poetry.dependencies]
|
@@ -89,6 +88,7 @@ async-generator = "^1.10"
|
|
89
88
|
|
90
89
|
python-magic = "^0.4.27"
|
91
90
|
json-repair = "^0.27.0"
|
91
|
+
cerebras-cloud-sdk = "^1.1.0"
|
92
92
|
|
93
93
|
|
94
94
|
[tool.poetry.extras]
|
File without changes
|
File without changes
|