You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This weave quickstart code has the wrong return type annotation
@weave.op()
def extract_dinos(sentence: str) -> dict:
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "system",
"content": """In JSON format extract a list of `dinosaurs`, with their `name`,
their `common_name`, and whether its `diet` is a herbivore or carnivore"""
},
{
"role": "user",
"content": sentence
}
],
response_format={ "type": "json_object" }
)
return response.choices[0].message.content
response.choices[0].message.content is a Str not a dict.
The text was updated successfully, but these errors were encountered:
This weave quickstart code has the wrong return type annotation
response.choices[0].message.content
is aStr
not adict
.The text was updated successfully, but these errors were encountered: