Fixups
This commit is contained in:
@@ -155,6 +155,7 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error
|
||||
),
|
||||
WithStateFile(stateFile),
|
||||
WithCharacterFile(characterFile),
|
||||
WithTimeout(timeout),
|
||||
WithRAGDB(a.ragDB),
|
||||
WithAgentReasoningCallback(func(state ActionCurrentState) bool {
|
||||
slog.Info("Reasoning", state.Reasoning)
|
||||
|
||||
@@ -61,6 +61,7 @@ func (g *GithubIssues) Start(a *agent.Agent) {
|
||||
slog.Info("Looking into github issues...")
|
||||
g.issuesService()
|
||||
case <-a.Context().Done():
|
||||
slog.Info("GithubIssues connector is now stopping")
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -152,25 +153,23 @@ func (g *GithubIssues) issuesService() {
|
||||
continue
|
||||
}
|
||||
|
||||
go func() {
|
||||
res := g.agent.Ask(
|
||||
agent.WithConversationHistory(messages),
|
||||
)
|
||||
if res.Error != nil {
|
||||
slog.Error("Error asking", "error", res.Error)
|
||||
return
|
||||
}
|
||||
res := g.agent.Ask(
|
||||
agent.WithConversationHistory(messages),
|
||||
)
|
||||
if res.Error != nil {
|
||||
slog.Error("Error asking", "error", res.Error)
|
||||
return
|
||||
}
|
||||
|
||||
_, _, err := g.client.Issues.CreateComment(
|
||||
g.agent.Context(),
|
||||
g.owner, g.repository,
|
||||
issue.GetNumber(), &github.IssueComment{
|
||||
Body: github.String(res.Response),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
slog.Error("Error creating comment", "error", err)
|
||||
}
|
||||
}()
|
||||
_, _, err := g.client.Issues.CreateComment(
|
||||
g.agent.Context(),
|
||||
g.owner, g.repository,
|
||||
issue.GetNumber(), &github.IssueComment{
|
||||
Body: github.String(res.Response),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
slog.Error("Error creating comment", "error", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ var apiURL = os.Getenv("API_URL")
|
||||
var apiKey = os.Getenv("API_KEY")
|
||||
var vectorStore = os.Getenv("VECTOR_STORE")
|
||||
var kbdisableIndexing = os.Getenv("KBDISABLEINDEX")
|
||||
var timeout = os.Getenv("TIMEOUT")
|
||||
|
||||
const defaultChunkSize = 4098
|
||||
|
||||
@@ -31,6 +32,9 @@ func init() {
|
||||
if apiURL == "" {
|
||||
apiURL = "http://192.168.68.113:8080"
|
||||
}
|
||||
if timeout == "" {
|
||||
timeout = "5m"
|
||||
}
|
||||
}
|
||||
|
||||
//go:embed views/*
|
||||
@@ -50,7 +54,7 @@ func main() {
|
||||
os.MkdirAll(stateDir, 0755)
|
||||
|
||||
var dbStore RAGDB
|
||||
lai := llm.NewClient(apiKey, apiURL+"/v1")
|
||||
lai := llm.NewClient(apiKey, apiURL+"/v1", timeout)
|
||||
|
||||
switch vectorStore {
|
||||
case "localai":
|
||||
|
||||
Reference in New Issue
Block a user