class documentation

class ResponseBuilders: (source)

View In Hierarchy

Builders for creating model responses for testing.

Warning

This API is experimental and may change in the future.

Static Method model_response Create a ModelResponse with the given output.
Static Method output_message Create a ModelResponse with an output message.
Static Method response_output_message Create a ResponseOutputMessage with text content.
Static Method tool_call Create a ModelResponse with a function tool call.
@staticmethod
def model_response(output: TResponseOutputItem) -> ModelResponse: (source)

Create a ModelResponse with the given output.

Warning

This API is experimental and may change in the future.

@staticmethod
def output_message(text: str) -> ModelResponse: (source)

Create a ModelResponse with an output message.

Warning

This API is experimental and may change in the future.

@staticmethod
def response_output_message(text: str) -> ResponseOutputMessage: (source)

Create a ResponseOutputMessage with text content.

Warning

This API is experimental and may change in the future.

@staticmethod
def tool_call(arguments: str, name: str) -> ModelResponse: (source)

Create a ModelResponse with a function tool call.

Warning

This API is experimental and may change in the future.