llama-index-llms-openai 0.3.10__py3-none-any.whl → 0.3.12__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.
- llama_index/llms/openai/py.typed +0 -0
- llama_index/llms/openai/utils.py +11 -4
- {llama_index_llms_openai-0.3.10.dist-info → llama_index_llms_openai-0.3.12.dist-info}/METADATA +2 -2
- llama_index_llms_openai-0.3.12.dist-info/RECORD +7 -0
- llama_index_llms_openai-0.3.10.dist-info/RECORD +0 -6
- {llama_index_llms_openai-0.3.10.dist-info → llama_index_llms_openai-0.3.12.dist-info}/WHEEL +0 -0
|
File without changes
|
llama_index/llms/openai/utils.py
CHANGED
|
@@ -34,12 +34,21 @@ DEFAULT_OPENAI_API_BASE = "https://api.openai.com/v1"
|
|
|
34
34
|
DEFAULT_OPENAI_API_VERSION = ""
|
|
35
35
|
|
|
36
36
|
O1_MODELS: Dict[str, int] = {
|
|
37
|
+
"o1": 200000,
|
|
38
|
+
"o1-2024-12-17": 200000,
|
|
37
39
|
"o1-preview": 128000,
|
|
38
40
|
"o1-preview-2024-09-12": 128000,
|
|
39
41
|
"o1-mini": 128000,
|
|
40
42
|
"o1-mini-2024-09-12": 128000,
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
O1_MODELS_WITHOUT_FUNCTION_CALLING = {
|
|
46
|
+
"o1-preview",
|
|
47
|
+
"o1-preview-2024-09-12",
|
|
48
|
+
"o1-mini",
|
|
49
|
+
"o1-mini-2024-09-12",
|
|
50
|
+
}
|
|
51
|
+
|
|
43
52
|
GPT4_MODELS: Dict[str, int] = {
|
|
44
53
|
# stable model names:
|
|
45
54
|
# resolves to gpt-4-0314 before 2023-06-27,
|
|
@@ -245,9 +254,7 @@ def is_function_calling_model(model: str) -> bool:
|
|
|
245
254
|
|
|
246
255
|
is_chat_model_ = is_chat_model(model)
|
|
247
256
|
is_old = "0314" in model or "0301" in model
|
|
248
|
-
|
|
249
|
-
# TODO: This is temporary for openai's beta
|
|
250
|
-
is_o1_beta = "o1" in model
|
|
257
|
+
is_o1_beta = model in O1_MODELS_WITHOUT_FUNCTION_CALLING
|
|
251
258
|
|
|
252
259
|
return is_chat_model_ and not is_old and not is_o1_beta
|
|
253
260
|
|
|
@@ -304,7 +311,7 @@ def to_openai_message_dict(
|
|
|
304
311
|
# TODO: O1 models do not support system prompts
|
|
305
312
|
if model is not None and model in O1_MODELS:
|
|
306
313
|
if message_dict["role"] == "system":
|
|
307
|
-
message_dict["role"] = "
|
|
314
|
+
message_dict["role"] = "developer"
|
|
308
315
|
|
|
309
316
|
# NOTE: openai messages have additional arguments:
|
|
310
317
|
# - function messages have `name`
|
{llama_index_llms_openai-0.3.10.dist-info → llama_index_llms_openai-0.3.12.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: llama-index-llms-openai
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.12
|
|
4
4
|
Summary: llama-index llms openai integration
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: llama-index
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Requires-Dist: llama-index-core (>=0.12.4,<0.13.0)
|
|
15
|
-
Requires-Dist: openai (>=1.
|
|
15
|
+
Requires-Dist: openai (>=1.58.1,<2.0.0)
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
|
|
18
18
|
# LlamaIndex Llms Integration: Openai
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
llama_index/llms/openai/__init__.py,sha256=vm3cIBSGkBFlE77GyfyN0EhpJcnJZN95QMhPN53EkbE,148
|
|
2
|
+
llama_index/llms/openai/base.py,sha256=_kW22tTABTKQ-GFRN00P5OOcJS4IeVAI3vPqbjw1D8o,35777
|
|
3
|
+
llama_index/llms/openai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
llama_index/llms/openai/utils.py,sha256=xGmeX1TbJaLjdtryETTGHR3-OSdrBm-79UxC9FlrrdE,18563
|
|
5
|
+
llama_index_llms_openai-0.3.12.dist-info/METADATA,sha256=n4knQjg7oDyUJSS8nL5YUNJrLbmNd9cdG-dMEEmWe7I,3321
|
|
6
|
+
llama_index_llms_openai-0.3.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
+
llama_index_llms_openai-0.3.12.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
llama_index/llms/openai/__init__.py,sha256=vm3cIBSGkBFlE77GyfyN0EhpJcnJZN95QMhPN53EkbE,148
|
|
2
|
-
llama_index/llms/openai/base.py,sha256=_kW22tTABTKQ-GFRN00P5OOcJS4IeVAI3vPqbjw1D8o,35777
|
|
3
|
-
llama_index/llms/openai/utils.py,sha256=q4qfub-sbjdfszucQCIXUyxc54_SKNM5xt84GXjKaXY,18400
|
|
4
|
-
llama_index_llms_openai-0.3.10.dist-info/METADATA,sha256=cDAY7NIsXdQDMDThNsifONnFKcsmWsbCaqeJw8TwXH0,3321
|
|
5
|
-
llama_index_llms_openai-0.3.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
6
|
-
llama_index_llms_openai-0.3.10.dist-info/RECORD,,
|
|
File without changes
|