Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOpenAPI ¶
func NewOpenAPI(cfg OpenAPIConfig, deps OpenAPIDeps) (agentkit.ToolProvider, error)
NewOpenAPI registers tool/openapi: Load api.json (an index of REST APIs described OpenAPI-compatibly) and expose each operation as a dynamic model-visible tool.
Best practices:
- Mount via tools/runtime deps.dynamicTools, not deps.tools, because definitions are discovered at runtime.
- api.json is an index: each entry under "apis" points at an external OpenAPI document via specFile, or inlines paths directly.
- Definitions are loaded once and cached; run the "openapi" command to reload api.json (and any specFile) from disk after editing it.
- Secrets in auth (token/value/password) accept "env:NAME" and resolve through credentials, same as tool/mcp.
Types ¶
type OpenAPIConfig ¶
type OpenAPIConfig struct {
// Files are api.json paths in precedence order; first file wins for duplicate API names.
Files []string `json:"files,omitempty"`
}
type OpenAPIDeps ¶
type OpenAPIDeps struct {
Workspace workspace.Service `json:"workspace"`
Credentials credentials.Store `json:"credentials,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.