Skip to content

Commit 31a65ca

Browse files
committed
Updated LLM
1 parent 3fc246b commit 31a65ca

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

context.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ import "context"
77

88
// Context is fed to the agent to generate a response
99
type Context interface {
10-
// Generate a response from the context
11-
Generate(context.Context, Model) (Context, error)
12-
13-
// Append user prompt (and attachments) to a context
14-
AppendUserPrompt(string, ...Opt) error
15-
16-
// Append the result of calling a tool to a context
17-
AppendToolResult(string, ...Opt) error
18-
19-
// Return the role, which can be assistant, user, tool, tool_result, ...
10+
// Return the role, which can be system, assistant, user, tool, tool_result, ...
2011
Role() string
2112

2213
// Return the text of the context
2314
Text() string
15+
16+
// Generate a response from a user prompt (with attachments)
17+
FromUser(context.Context, string, ...Opt) (Context, error)
18+
19+
// Generate a response from a tool result
20+
FromTool(context.Context, ...any) (Context, error)
2421
}

pkg/agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var _ llm.Agent = (*Agent)(nil)
2828
///////////////////////////////////////////////////////////////////////////////
2929
// LIFECYCLE
3030

31-
// Return a new agent, composed of a series of agents and tools
31+
// Return a new agent, composed of a series of agents and tools
3232
func New(opts ...llm.Opt) (*Agent, error) {
3333
agent := new(Agent)
3434
if opt, err := apply(opts...); err != nil {

0 commit comments

Comments
 (0)