0.0.0+develop

flytekitplugins.openai.batch.agent

Directory

Classes

Class Description
BatchEndpointAgent This is the base class for all async agents.
BatchEndpointMetadata

Variables

Property Type Description
OPENAI_API_KEY str

flytekitplugins.openai.batch.agent.BatchEndpointAgent

This is the base class for all async agents. It defines the interface that all agents must implement. The agent service is responsible for invoking agents. The propeller will communicate with the agent service to create tasks, get the status of tasks, and delete tasks.

All the agents should be registered in the AgentRegistry. Agent Service will look up the agent based on the task type. Every task type can only have one agent.

def BatchEndpointAgent()

Methods

Method Description
create() Return a resource meta that can be used to get the status of the task.
delete() Delete the task.
get() Return the status of the task, and return the outputs in some cases.

create()

def create(
    task_template: flytekit.models.task.TaskTemplate,
    inputs: typing.Optional[flytekit.models.literals.LiteralMap],
    kwargs,
) -> flytekitplugins.openai.batch.agent.BatchEndpointMetadata

Return a resource meta that can be used to get the status of the task.

Parameter Type
task_template flytekit.models.task.TaskTemplate
inputs typing.Optional[flytekit.models.literals.LiteralMap]
kwargs **kwargs

delete()

def delete(
    resource_meta: flytekitplugins.openai.batch.agent.BatchEndpointMetadata,
    kwargs,
)

Delete the task. This call should be idempotent. It should raise an error if fails to delete the task.

Parameter Type
resource_meta flytekitplugins.openai.batch.agent.BatchEndpointMetadata
kwargs **kwargs

get()

def get(
    resource_meta: flytekitplugins.openai.batch.agent.BatchEndpointMetadata,
    kwargs,
) -> flytekit.extend.backend.base_agent.Resource

Return the status of the task, and return the outputs in some cases. For example, bigquery job can’t write the structured dataset to the output location, so it returns the output literals to the propeller, and the propeller will write the structured dataset to the blob store.

Parameter Type
resource_meta flytekitplugins.openai.batch.agent.BatchEndpointMetadata
kwargs **kwargs

Properties

Property Type Description
metadata_type
task_category
task category that the agent supports

flytekitplugins.openai.batch.agent.BatchEndpointMetadata

class BatchEndpointMetadata(
    openai_org: str,
    batch_id: str,
)
Parameter Type
openai_org str
batch_id str

Methods

Method Description
decode() Decode the resource meta from bytes.
encode() Encode the resource meta to bytes.

decode()

def decode(
    data: bytes,
) -> BatchEndpointMetadata

Decode the resource meta from bytes.

Parameter Type
data bytes

encode()

def encode()

Encode the resource meta to bytes.