Skip to content

Is it possible to provide built_in_code_execution ability to read from a file? #774

Closed Answered by bugthedebugger
bugthedebugger asked this question in Q&A
Discussion options

You must be logged in to vote

To anyone who ends up here with the same issue as above, i figured it out. Its not documented anywhere. You NEED to use VertexAiCodeExecutor in order for the code executor to read artifacts/files and pass the artifact as part to be able to read the generated artifacts within the code executor.

Agent(
    name='agent_name',
    model='gemini-2.0-flash',
    description=<description goes here>,
    instruction="""<instruction goes here>""",
    # tools=[built_in_code_execution]
    code_executor=VertexAiCodeExecutor(
        optimize_data_file=True,
        stateful=True,
    )
)
csv_artifact = types.Part(
        inline_data=types.Blob(
            display_name="test_data.csv",
            m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bugthedebugger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant