Skip to main content

convert_to_galileo_message

def convert_to_galileo_message(data: Any, default_role: str='user') -> Message
Convert OpenAI response data to a Galileo Message object.

has_pending_function_calls

def has_pending_function_calls(output_items: list) -> bool
Check if the response has pending function calls that require tool execution. Returns True if there are function_call items but no final message content. This indicates the model is waiting for tool results before producing a final response.

process_function_call_outputs

def process_function_call_outputs(input_items: list,
                                  galileo_logger: GalileoLogger) -> None
Process function_call and function_call_output items from the input and create combined tool spans. This joins the function call (model’s request to call a tool) with the function output (tool result) into a single tool span, representing the complete tool execution.

process_output_items

def process_output_items(output_items: list,
                         galileo_logger: GalileoLogger,
                         model: Optional[str]=None,
                         original_input: Optional[list]=None,
                         model_parameters: Optional[dict]=None,
                         status_code: int=200,
                         tools: Optional[list]=None,
                         usage: Optional[dict]=None) -> list
The responses API returns an array of output items. This function processes output items sequentially, consolidating reasoning into the main response content and creating tool spans for specific tool call types.