import instructor import openai # Enables response_model in the openai client instructor.patch() query = openai.ChatCompletion.create( model="gpt-4", response_model=MetaphorQuery, messages=[ { "role": "system", "content": "You're a query understanding system for the Metafor Systems search engine. Here are some tips: ..." }, { "role": "user", "content": "What are some recent developments in AI?" } ], )
asyncdefexecute(self) -> str: returnawait asyncio.gather(*[query.execute() for query in self.queries])
import instructor import openai
# Enables response_model in the openai client instructor.patch() retrival = openai.ChatCompletion.create( model="gpt-4", response_model=Retrival, messages=[ {"role": "system", "content": "You are Jason's personal assistant."}, {"role": "user", "content": "What do I have today?"} ], )