Skip to content

Model Handler

osa_tool.osatreesitter.models.ModelHandler

Bases: ABC

This class handles the sending of requests to a specified URL and the initialization of payloads for instances.

Methods:

Name Description
send_request

Sends a request to a specified URL and returns the response. The response is of type requests.Response.

initialize_payload

Initializes the payload for the instance using the provided configuration and prompt. The payload is generated using the payloadFactory and is then converted to payload completions and stored in the instance's payload attribute. The method takes two arguments: config which are the configuration settings to be used for payload generation, and prompt which is the prompt to be used for payload generation. The method does not return anything.

initialize_payload(config, prompt)

Initializes the payload for the instance.

This method uses the provided configuration and prompt to generate a payload using the payloadFactory. The generated payload is then converted to payload completions and stored in the instance's payload attribute.

Parameters:

Name Type Description Default
config Settings

The configuration settings to be used for payload generation.

required
prompt str

The prompt to be used for payload generation.

required

Returns:

Type Description
None

None