INNER CODE UNIT · Go
newCopilotProvider
k1LoW/runn · agent_copilot.go:20
func newCopilotProvider(cfg *AgentRunnerConfig) (*copilotProvider, error) {
clientOpts := &copilot.ClientOptions{}
sessionCfg := &copilot.SessionConfig{
ClientName: "runn",
}
if cfg.Model != "" {
sessionCfg.Model = cfg.Model
}
if cfg.System != "" {
sessionCfg.SystemMessage = &copilot.SystemMessageConfig{
Mode: "custom",
Content: cfg.System,
}
}
if len(cfg.Tools) > 0 {
sessionCfg.AvailableTools = cfg.Tools