mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
Azure support multitask.py (#136)
Azure support for Multiple Extractions
This commit is contained in:
@@ -31,9 +31,11 @@ class MultiTaskBase:
|
||||
@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):
|
||||
|
||||
Reference in New Issue
Block a user