Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
henomis committed Jun 2, 2024
1 parent 1689742 commit 9d6ebcc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
31 changes: 20 additions & 11 deletions assistant/assistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,7 @@ func (a *Assistant) Run(ctx context.Context) error {
}

for i := 0; i < int(a.maxIterations); i++ {
ctx, spanIteration, err := a.startObserveSpan(ctx, fmt.Sprintf("iteration-%d", i+1))
if err != nil {
return err
}

err = a.llm.Generate(ctx, a.thread)
if err != nil {
return err
}

err = a.stopObserveSpan(ctx, spanIteration)
err = a.runIteration(ctx, i)
if err != nil {
return err
}
Expand All @@ -123,6 +113,25 @@ func (a *Assistant) Run(ctx context.Context) error {
return nil
}

func (a *Assistant) runIteration(ctx context.Context, iteration int) error {
ctx, spanIteration, err := a.startObserveSpan(ctx, fmt.Sprintf("iteration-%d", iteration+1))
if err != nil {
return err
}

err = a.llm.Generate(ctx, a.thread)
if err != nil {
return err
}

err = a.stopObserveSpan(ctx, spanIteration)
if err != nil {
return err
}

return nil
}

func (a *Assistant) RunWithThread(ctx context.Context, thread *thread.Thread) error {
a.thread = thread
return a.Run(ctx)
Expand Down
1 change: 1 addition & 0 deletions tool/python/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (t *Tool) Name() string {
return "python"
}

//nolint:lll
func (t *Tool) Description() string {
return "A tool that runs Python code using the Python interpreter. Use this tool to solve calculations, manipulate data, or perform any other Python-related tasks. The code should print the final result to stdout."
}
Expand Down

0 comments on commit 9d6ebcc

Please sign in to comment.