Skip to content

Open ai agent python #983

Closed
Closed
@Dexter2211-collab

Description

@Dexter2211-collab

Yes you can do something like this:

class MyContext:
  should_enable_foo_tool: bool = False

def is_foo_enabled(ctx, agent) -> bool:
  return ctx.context.should_enable_foo_tool

@function_tool(is_enabled=is_foo_enabled)
def foo_tool(...):
  ...

Originally posted by @rm-openai in #918

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions