Find answers from the community

Updated 8 months ago

is there a way, for me to, within an

is there a way, for me to, within an openai agent tool, access the query engine / user message?
Plain Text
def create_gif_from_timestamps(video_path: str, output_path: str, start_time: str, end_time: str) -> str:
    """
    Create a GIF from an MP4 video using the specified timestamps.

    Parameters:
    - video_path: The path to the input MP4 video file.
    - output_path: The path where the output GIF file will be saved.
    - start_time: The start timestamp in the format "HH:MM:SS" indicating the beginning of the GIF.
    - end_time: The end timestamp in the format "HH:MM:SS" indicating the end of the GIF.

    Returns:
    - The path to the generated GIF file.
    """
    clip = VideoFileClip(video_path).subclip(start_time, end_time)
    clip.write_gif(output_path)
    return output_path

gif_tool = FunctionTool.from_defaults(fn=create_gif_from_timestamps)

i want to be able to query the index, grab a document, use that document to get file path / timestamps from metadata, then make a gif and return it
L
m
3 comments
When inside a tool, all you have access to are the things that are passed in, as well as whatever else is in the parent/global scope πŸ€”
i see okay, so if i degine the query engine ahead i can just access that, cool

Was curious if there was like a "self" i could reference to get tools or whatever off the agent
Yea not quite, no self to reference here πŸ€”
Add a reply
Sign up and join the conversation on Discord