This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-core/tools/reasoning.go

26 lines
655 B
Go

package tools
import (
"context"
"encoding/json"
"fmt"
"ollie/toolsrv"
)
// Think is a scratchpad for externalizing reasoning. The thought is recorded
// in conversation history but not shown to the user. Takes up practically
// zero context space — the value is in writing it.
func Think(ctx context.Context, srv *toolsrv.Server, args json.RawMessage) (string, error) {
var a struct {
Thought string `json:"thought"`
}
if err := json.Unmarshal(args, &a); err != nil {
return "", fmt.Errorf("reasoning_think: bad args: %w", err)
}
if a.Thought == "" {
return "", fmt.Errorf("reasoning_think: thought is required")
}
return "", nil
}