Skip to content

marvin.beta.assistants.formatting

download_temp_file

Downloads a file from OpenAI's servers and saves it to a temporary file.

Parameters:

Name Type Description Default
file_id str

The ID of the file to be downloaded.

required
suffix str

The file extension to be used for the temporary file.

None

Returns:

Type Description

The file path of the downloaded temporary file.

pprint_message

Pretty-prints a single message using the rich library, highlighting the speaker's role, the message text, any available images, and the message timestamp in a panel format.

Parameters:

Name Type Description Default
message ThreadMessage

A message object

required

pprint_messages

Iterates over a list of messages and pretty-prints each one.

Messages are pretty-printed using the rich library, highlighting the speaker's role, the message text, any available images, and the message timestamp in a panel format.

Parameters:

Name Type Description Default
messages list[ThreadMessage]

A list of ThreadMessage objects to be printed.

required

pprint_run_step

Formats and prints a run step with status information.

Parameters:

Name Type Description Default
run_step RunStep

A RunStep object containing the details of the run step.

required