Documentation
¶
Index ¶
- type Client
- func (c *Client) GenerateComponent(ctx context.Context, spec ai.ComponentSpec) (string, error)
- func (c *Client) GenerateWorkflow(ctx context.Context, req ai.GenerateRequest) (*ai.GenerateResponse, error)
- func (c *Client) IdentifyMissingComponents(ctx context.Context, cfg *config.WorkflowConfig) ([]ai.ComponentSpec, error)
- func (c *Client) SuggestWorkflow(ctx context.Context, useCase string) ([]ai.WorkflowSuggestion, error)
- type ClientConfig
- type ClientWrapper
- type SessionWrapper
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 ¶
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)
Destroy() error
}
SessionWrapper wraps the methods we use from copilot.Session so they can be mocked.