[docs]asyncdefquery_evolve_openai_base(row:Dict,client:AsyncClient,messages:List[ChatMessage],model_name:str="gpt-4o-2024-08-06",):""" Evolve the original query to a new evolved query using OpenAI structured outputs. """original_query=row["query"]context=list(itertools.chain.from_iterable(row["retrieval_gt_contents"]))context_str="Text:\n"+"\n".join([f"{i+1}. {c}"fori,cinenumerate(context)])user_prompt=f"Question: {original_query}\nContext: {context_str}\nOutput: "messages.append(ChatMessage(role=MessageRole.USER,content=user_prompt))completion=awaitclient.beta.chat.completions.parse(model=model_name,messages=to_openai_message_dicts(messages),response_format=Response,)row["query"]=completion.choices[0].message.parsed.evolved_queryreturnrow