llama-index-llms-openai 0.2.14__tar.gz → 0.2.16__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-index-llms-openai
3
- Version: 0.2.14
3
+ Version: 0.2.16
4
4
  Summary: llama-index llms openai integration
5
5
  License: MIT
6
6
  Author: llama-index
@@ -478,6 +478,9 @@ class OpenAI(FunctionCallingLLM):
478
478
  else:
479
479
  delta = ChoiceDelta()
480
480
 
481
+ if delta is None:
482
+ continue
483
+
481
484
  # check if this chunk is the start of a function call
482
485
  if delta.tool_calls:
483
486
  is_function = True
@@ -729,6 +732,9 @@ class OpenAI(FunctionCallingLLM):
729
732
  delta = ChoiceDelta()
730
733
  first_chat_chunk = False
731
734
 
735
+ if delta is None:
736
+ continue
737
+
732
738
  # check if this chunk is the start of a function call
733
739
  if delta.tool_calls:
734
740
  is_function = True
@@ -229,6 +229,14 @@ def is_chat_model(model: str) -> bool:
229
229
 
230
230
 
231
231
  def is_function_calling_model(model: str) -> bool:
232
+ # checking whether the model is fine-tuned or not.
233
+ # fine-tuned model names these days look like:
234
+ # ft:gpt-3.5-turbo:acemeco:suffix:abc123
235
+ if model.startswith("ft-"): # legacy fine-tuning
236
+ model = model.split(":")[0]
237
+ elif model.startswith("ft:"):
238
+ model = model.split(":")[1]
239
+
232
240
  is_chat_model_ = is_chat_model(model)
233
241
  is_old = "0314" in model or "0301" in model
234
242
 
@@ -29,7 +29,7 @@ exclude = ["**/BUILD"]
29
29
  license = "MIT"
30
30
  name = "llama-index-llms-openai"
31
31
  readme = "README.md"
32
- version = "0.2.14"
32
+ version = "0.2.16"
33
33
 
34
34
  [tool.poetry.dependencies]
35
35
  python = ">=3.8.1,<4.0"