copilotai

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements ai.WorkflowGenerator using the GitHub Copilot SDK.

func NewClient

func NewClient(cfg ClientConfig) (*Client, error)

NewClient creates a new Copilot SDK client. The Copilot CLI must be available.

func (*Client) GenerateComponent

func (c *Client) GenerateComponent(ctx context.Context, spec ai.ComponentSpec) (string, error)

GenerateComponent generates Go source code for a component.

func (*Client) GenerateWorkflow

func (c *Client) GenerateWorkflow(ctx context.Context, req ai.GenerateRequest) (*ai.GenerateResponse, error)

GenerateWorkflow creates a workflow config from a natural language request.

func (*Client) IdentifyMissingComponents

func (c *Client) IdentifyMissingComponents(ctx context.Context, cfg *config.WorkflowConfig) ([]ai.ComponentSpec, error)

IdentifyMissingComponents analyzes a config for non-built-in module types.

func (*Client) SuggestWorkflow

func (c *Client) SuggestWorkflow(ctx context.Context, useCase string) ([]ai.WorkflowSuggestion, error)

SuggestWorkflow returns workflow suggestions for a use case.

type ClientConfig

type ClientConfig struct {
	// CLIPath is the path to the Copilot CLI binary.
	CLIPath string
	// Model to use for sessions (e.g., "claude-sonnet-4-20250514").
	Model string
	// Provider configures BYOK (Bring Your Own Key) for custom model providers.
	Provider *copilot.ProviderConfig
}

ClientConfig holds configuration for the Copilot SDK client.

type ClientWrapper

type ClientWrapper interface {
	CreateSession(ctx context.Context, cfg *copilot.SessionConfig) (SessionWrapper, error)
}

ClientWrapper wraps the methods we use from copilot.Client so they can be mocked.

type SessionWrapper

type SessionWrapper interface {
	SendAndWait(ctx context.Context, opts copilot.MessageOptions) (*copilot.SessionEvent, error)
	Disconnect() error
}

SessionWrapper wraps the methods we use from copilot.Session so they can be mocked.

Jump to

Keyboard shortcuts

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