Skip to content

Commit

Permalink
Azure support multitask.py (#136)
Browse files Browse the repository at this point in the history
Azure support for Multiple Extractions
  • Loading branch information
zboyles authored Nov 4, 2023
1 parent 337fe77 commit fc15d8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions instructor/dsl/multitask.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def tasks_from_chunks(cls, json_chunks):
@staticmethod
def extract_json(completion):
for chunk in completion:
delta = chunk["choices"][0]["delta"]
if "function_call" in delta:
yield delta["function_call"]["arguments"]
if chunk["choices"]:
delta = chunk["choices"][0]["delta"]
if "function_call" in delta:
if "arguments" in delta["function_call"]:
yield delta["function_call"]["arguments"]

@staticmethod
def get_object(str, stack):
Expand Down

0 comments on commit fc15d8c

Please sign in to comment.