ai

package
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxContextFiles is the default maximum number of stack files to include in AI context.
	DefaultMaxContextFiles = 10
	// DefaultMaxContextLines is the default maximum number of lines per stack file in AI context.
	DefaultMaxContextLines = 500
)
View Source
const AutoProvider = "auto"

AutoProvider is the explicit default_provider value requesting CLI auto-detection. It behaves identically to leaving default_provider unset, but lets a shared atmos.yaml (e.g. checked into git for a team) spell out the "pick whatever CLI tool is installed" intent explicitly instead of relying on an absent field to mean the same thing.

Variables

This section is empty.

Functions

func GatherStackContext

func GatherStackContext(atmosConfig *schema.AtmosConfiguration) (string, error)

GatherStackContext reads stack configurations and returns them as context for AI.

func GetProvider added in v1.223.0

func GetProvider(atmosConfig *schema.AtmosConfiguration) string

GetProvider returns the AI provider to use: the explicitly configured provider if set, otherwise the first CLI provider (claude-code, codex-cli, copilot-cli, gemini-cli) whose binary is found on PATH, otherwise "anthropic". Leaving default_provider empty or setting it to AutoProvider ("auto") both trigger auto-detection.

func GetProviderConfig

func GetProviderConfig(atmosConfig *schema.AtmosConfiguration, provider string) (*schema.AIProviderConfig, error)

GetProviderConfig returns the configuration for a specific provider.

func IsCLIProvider added in v1.223.0

func IsCLIProvider(providerName string) bool

IsCLIProvider returns true if the named provider invokes a local CLI binary rather than calling an API directly.

func PromptForConsent

func PromptForConsent() (bool, error)

PromptForConsent asks the user for consent to send context to AI.

func QuestionNeedsContext

func QuestionNeedsContext(question string) bool

QuestionNeedsContext determines if a question likely needs repository context.

func RedactSecrets

func RedactSecrets(text string) string

ReductSecrets replaces sensitive information with a masked value.

func SanitizeContext

func SanitizeContext(context string) string

SanitizeContext removes sensitive information from context before sending to AI.

func ShouldSendContext

func ShouldSendContext(atmosConfig *schema.AtmosConfiguration, question string) (bool, bool, error)

ShouldSendContext determines if context should be sent based on configuration and environment.

Types

type Client

type Client = registry.Client

Client is the AI client interface. It is an alias to registry.Client to maintain backward compatibility.

func NewClient

func NewClient(atmosConfig *schema.AtmosConfiguration) (Client, error)

NewClient creates a new AI client based on the provider configuration.

func NewClientWithContext

func NewClientWithContext(ctx context.Context, atmosConfig *schema.AtmosConfiguration) (Client, error)

NewClientWithContext creates a new AI client with the given context.

Directories

Path Synopsis
agent
base
Package base provides shared utilities for AI provider implementations.
Package base provides shared utilities for AI provider implementations.
base/openaicompat
Package openaicompat provides shared utilities for OpenAI-compatible API providers.
Package openaicompat provides shared utilities for OpenAI-compatible API providers.
claudecode
Package claudecode provides an AI provider that invokes the Claude Code CLI as a subprocess, reusing the user's Claude Pro/Max subscription instead of requiring separate API tokens.
Package claudecode provides an AI provider that invokes the Claude Code CLI as a subprocess, reusing the user's Claude Pro/Max subscription instead of requiring separate API tokens.
codexcli
Package codexcli provides an AI provider that invokes the OpenAI Codex CLI as a subprocess, reusing the user's ChatGPT Plus/Pro subscription.
Package codexcli provides an AI provider that invokes the OpenAI Codex CLI as a subprocess, reusing the user's ChatGPT Plus/Pro subscription.
copilotcli
Package copilotcli provides an AI provider that invokes the GitHub Copilot CLI as a subprocess, reusing the user's GitHub Copilot subscription.
Package copilotcli provides an AI provider that invokes the GitHub Copilot CLI as a subprocess, reusing the user's GitHub Copilot subscription.
geminicli
Package geminicli provides an AI provider that invokes the Gemini CLI as a subprocess, reusing the user's Google account (free tier or API key).
Package geminicli provides an AI provider that invokes the Gemini CLI as a subprocess, reusing the user's Google account (free tier or API key).
github
Package github provides an AI provider backed by GitHub Models.
Package github provides an AI provider backed by GitHub Models.
Package analyze provides AI-powered analysis of CLI command output.
Package analyze provides AI-powered analysis of CLI command output.
Package registry provides the AI provider registry for client creation.
Package registry provides the AI provider registry for client creation.
Package session is a generated GoMock package.
Package session is a generated GoMock package.

Jump to

Keyboard shortcuts

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