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
Hi! I noticed when using tool calls (function calling) that I get an empty assistant message in the UI (because there's no content, just tool calls). See below:
Would be awesome if this rendered something like a pretty JSON object so it's not empty and I don't have to scroll down to the original response to find the data.
The text was updated successfully, but these errors were encountered:
I've confirmed this is working with OpenAI (as well as other providers through Mirascope).
Here is a Mirascope snippet that works with Logfire and the new function calling UI:
fromtypingimportLiteral, TypeimportlogfirefrompydanticimportBaseModelfrommirascope.logfireimportwith_logfirefrommirascope.openaiimportOpenAIExtractorlogfire.configure()
classTaskDetails(BaseModel):
description: strdue_date: strpriority: Literal["low", "normal", "high"]
@with_logfireclassTaskExtractor(OpenAIExtractor[TaskDetails]):
extract_schema: Type[TaskDetails] =TaskDetailsprompt_template=""" Extract the task details from the following task: {task} """task: strtask="Submit quarterly report by next Friday. Task is high priority."task_details=TaskExtractor(
task=task
).extract() # this will be logged automatically with logfireassertisinstance(task_details, TaskDetails)
print(task_details)
Hi! I noticed when using tool calls (function calling) that I get an empty assistant message in the UI (because there's no content, just tool calls). See below:
Would be awesome if this rendered something like a pretty JSON object so it's not empty and I don't have to scroll down to the original response to find the data.
The text was updated successfully, but these errors were encountered: