openapi

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 19 Imported by: 0

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 OpenAPI document via path (specFile is a legacy alias).
  • 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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL