utils.llm_responseΒΆ

class celi_framework.utils.llm_response.FunctionCall(**data)

Bases: BaseModel

arguments: str

The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'arguments': FieldInfo(annotation=str, required=True), 'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

name: str

The name of the function to call.

class celi_framework.utils.llm_response.LLMResponse(**data)

Bases: BaseModel

content: Optional[str]
finish_reason: Literal['stop', 'length', 'tool_calls', 'content_filter']
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'content': FieldInfo(annotation=Union[str, NoneType], required=True), 'finish_reason': FieldInfo(annotation=Literal['stop', 'length', 'tool_calls', 'content_filter'], required=True), 'tool_calls': FieldInfo(annotation=Union[List[ToolCall], NoneType], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

tool_calls: Optional[List[ToolCall]]
class celi_framework.utils.llm_response.ToolCall(**data)

Bases: BaseModel

function: FunctionCall

The function that the model called.

id: str

The ID of the tool call.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'function': FieldInfo(annotation=FunctionCall, required=True), 'id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Literal['function'], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

type: Literal['function']

The type of the tool. Currently, only function is supported.