create_openapi_agent(
api_spec: ReducedOpenAPISpec,
requests_wrapper: RequestsWrapper,
llm: BaseLanguageModel,
shared_memory| Name | Type | Description |
|---|---|---|
api_spec* | ReducedOpenAPISpec | The OpenAPI spec. |
requests_wrapper* | RequestsWrapper | The requests wrapper. |
llm* | BaseLanguageModel | The language model. |
shared_memory | Optional[Any] | Default: None |
callback_manager | Optional[BaseCallbackManager] | Default: None |
verbose | bool | Default: True |
agent_executor_kwargs | Optional[Dict[str, Any]] | Default: None |
allow_dangerous_requests | bool | Default: False |
allowed_operations | Sequence[Operation] | Default: ('GET', 'POST') |
kwargs | Any | Default: {} |
Construct an OpenAI API planner and controller for a given spec.
Inject credentials via requests_wrapper.
We use a top-level "orchestrator" agent to invoke the planner and controller, rather than a top-level planner that invokes a controller with its plan. This is to keep the planner simple.
You need to set allow_dangerous_requests to True to use Agent with BaseRequestsTool. Requests can be dangerous and can lead to security vulnerabilities. For example, users can ask a server to make a request to an internal server. It's recommended to use requests through a proxy server and avoid accepting inputs from untrusted sources without proper sandboxing. Please see: https://python.langchain.com/docs/security for further security information.
Optional. The shared memory. Default is None.
Optional. The callback manager. Default is None.
Optional. Whether to print verbose output. Default is True.
Optional. Additional keyword arguments for the agent executor.
Optional. Whether to allow dangerous requests. Default is False.
Optional. The allowed operations. Default is ("GET", "POST").
Additional arguments.