> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# extractors

## convert\_to\_galileo\_message

```python theme={null}
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

```python theme={null}
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

```python theme={null}
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

```python theme={null}
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.
