Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions quickstart/chatwitheino/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func buildAgentTyped[M adk.MessageType](ctx context.Context) (adk.TypedResumable
return nil, err
}

ragTool, err := rag.BuildTool[M](ctx, cm)
ragTool, err := rag.BuildTool(ctx, cm)
if err != nil {
return nil, fmt.Errorf("build rag tool: %w", err)
}
Expand All @@ -61,7 +61,7 @@ func buildAgentTyped[M adk.MessageType](ctx context.Context) (adk.TypedResumable
if sbErr != nil {
return nil, sbErr
}
skillMiddleware, smErr := skill.NewTyped[M](ctx, &skill.TypedConfig[M]{
skillMiddleware, smErr := skill.NewTyped(ctx, &skill.TypedConfig[M]{
Backend: skillBackend,
})
if smErr != nil {
Expand All @@ -86,7 +86,7 @@ func buildAgentTyped[M adk.MessageType](ctx context.Context) (adk.TypedResumable
},
}
helpers.ApplyMessageModelRetry(cfg)
return deep.NewTyped[M](ctx, cfg)
return deep.NewTyped(ctx, cfg)
}

func resolveSkillsDir() (string, bool) {
Expand Down
2 changes: 1 addition & 1 deletion quickstart/chatwitheino/cmd/ch02/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func runTyped[M adk.MessageType](ctx context.Context, instruction string) {
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
})
Expand Down
4 changes: 2 additions & 2 deletions quickstart/chatwitheino/cmd/ch03/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func runTyped[M adk.MessageType](ctx context.Context, sessionID, instruction str
os.Exit(1)
}

agent, err := adk.NewTypedChatModelAgent[M](ctx, &adk.TypedChatModelAgentConfig[M]{
agent, err := adk.NewTypedChatModelAgent(ctx, &adk.TypedChatModelAgentConfig[M]{
Name: "Ch03MemoryAgent",
Description: "ChatModelAgent with JSONL-based persistent session.",
Instruction: instruction,
Expand All @@ -69,7 +69,7 @@ func runTyped[M adk.MessageType](ctx context.Context, sessionID, instruction str
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
})
Expand Down
6 changes: 3 additions & 3 deletions quickstart/chatwitheino/cmd/ch04/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
os.Exit(1)
}

agent, err := deep.NewTyped[M](ctx, &deep.TypedConfig[M]{
agent, err := deep.NewTyped(ctx, &deep.TypedConfig[M]{
Name: "Ch04ToolAgent",
Description: "ChatWithDoc agent with filesystem access via LocalBackend.",
ChatModel: cm,
Expand All @@ -109,7 +109,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
})
Expand Down Expand Up @@ -158,7 +158,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

history := session.GetMessages()
events := runner.Run(ctx, msgops.NormalizeMessagesForModelInput(history))
result, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
result, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
})
Expand Down
6 changes: 3 additions & 3 deletions quickstart/chatwitheino/cmd/ch05/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
},
}
helpers.ApplyMessageModelRetry(cfg)
agent, err := deep.NewTyped[M](ctx, cfg)
agent, err := deep.NewTyped(ctx, cfg)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
})
Expand Down Expand Up @@ -162,7 +162,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

history := session.GetMessages()
events := runner.Run(ctx, msgops.NormalizeMessagesForModelInput(history))
result, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
result, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
})
Expand Down
6 changes: 3 additions & 3 deletions quickstart/chatwitheino/cmd/ch06/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
},
}
helpers.ApplyMessageModelRetry(cfg)
agent, err := deep.NewTyped[M](ctx, cfg)
agent, err := deep.NewTyped(ctx, cfg)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
})
Expand Down Expand Up @@ -190,7 +190,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

history := session.GetMessages()
events := runner.Run(ctx, msgops.NormalizeMessagesForModelInput(history))
result, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
result, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
})
Expand Down
12 changes: 6 additions & 6 deletions quickstart/chatwitheino/cmd/ch07/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
},
}
helpers.ApplyMessageModelRetry(cfg)
agent, err := deep.NewTyped[M](ctx, cfg)
agent, err := deep.NewTyped(ctx, cfg)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
CheckPointStore: adkstore.NewInMemoryStore(),
Expand Down Expand Up @@ -202,7 +202,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

history := session.GetMessages()
events := runner.Run(ctx, msgops.NormalizeMessagesForModelInput(history), adk.WithCheckPointID(checkPointID))
result, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
result, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
CaptureInterrupt: true,
Expand All @@ -214,7 +214,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

assistantText := result.AssistantText
if result.InterruptInfo != nil {
assistantText, err = handleInterrupt[M](ctx, runner, checkPointID, result.InterruptInfo, reader)
assistantText, err = handleInterrupt(ctx, runner, checkPointID, result.InterruptInfo, reader)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down Expand Up @@ -362,7 +362,7 @@ func handleInterrupt[M adk.MessageType](ctx context.Context, runner *adk.TypedRu
return "", fmt.Errorf("failed to resume: %w", err)
}

resumeResult, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
resumeResult, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
CaptureInterrupt: true,
Expand All @@ -372,7 +372,7 @@ func handleInterrupt[M adk.MessageType](ctx context.Context, runner *adk.TypedRu
}

if resumeResult.InterruptInfo != nil {
return handleInterrupt[M](ctx, runner, checkPointID, resumeResult.InterruptInfo, reader)
return handleInterrupt(ctx, runner, checkPointID, resumeResult.InterruptInfo, reader)
}

return resumeResult.AssistantText, nil
Expand Down
14 changes: 7 additions & 7 deletions quickstart/chatwitheino/cmd/ch08/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
}

// Build RAG tool
ragTool, err := rag.BuildTool[M](ctx, cm)
ragTool, err := rag.BuildTool(ctx, cm)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, fmt.Errorf("build rag tool: %w", err))
os.Exit(1)
Expand All @@ -154,13 +154,13 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
},
}
helpers.ApplyMessageModelRetry(cfg)
agent, err := deep.NewTyped[M](ctx, cfg)
agent, err := deep.NewTyped(ctx, cfg)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
CheckPointStore: adkstore.NewInMemoryStore(),
Expand Down Expand Up @@ -216,7 +216,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

history := session.GetMessages()
events := runner.Run(ctx, msgops.NormalizeMessagesForModelInput(history), adk.WithCheckPointID(checkPointID))
result, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
result, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
CaptureInterrupt: true,
Expand All @@ -228,7 +228,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

assistantText := result.AssistantText
if result.InterruptInfo != nil {
assistantText, err = handleInterrupt[M](ctx, runner, checkPointID, result.InterruptInfo, reader)
assistantText, err = handleInterrupt(ctx, runner, checkPointID, result.InterruptInfo, reader)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down Expand Up @@ -376,7 +376,7 @@ func handleInterrupt[M adk.MessageType](ctx context.Context, runner *adk.TypedRu
return "", fmt.Errorf("failed to resume: %w", err)
}

resumeResult, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
resumeResult, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
CaptureInterrupt: true,
Expand All @@ -386,7 +386,7 @@ func handleInterrupt[M adk.MessageType](ctx context.Context, runner *adk.TypedRu
}

if resumeResult.InterruptInfo != nil {
return handleInterrupt[M](ctx, runner, checkPointID, resumeResult.InterruptInfo, reader)
return handleInterrupt(ctx, runner, checkPointID, resumeResult.InterruptInfo, reader)
}

return resumeResult.AssistantText, nil
Expand Down
16 changes: 8 additions & 8 deletions quickstart/chatwitheino/cmd/ch09/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
os.Exit(1)
}

ragTool, err := rag.BuildTool[M](ctx, cm)
ragTool, err := rag.BuildTool(ctx, cm)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, fmt.Errorf("build rag tool: %w", err))
os.Exit(1)
Expand All @@ -145,7 +145,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
_, _ = fmt.Fprintln(os.Stderr, sbErr)
os.Exit(1)
}
skillMiddleware, smErr := skill.NewTyped[M](ctx, &skill.TypedConfig[M]{
skillMiddleware, smErr := skill.NewTyped(ctx, &skill.TypedConfig[M]{
Backend: skillBackend,
})
if smErr != nil {
Expand All @@ -172,13 +172,13 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR
},
}
helpers.ApplyMessageModelRetry(cfg)
agent, err := deep.NewTyped[M](ctx, cfg)
agent, err := deep.NewTyped(ctx, cfg)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
CheckPointStore: adkstore.NewInMemoryStore(),
Expand Down Expand Up @@ -239,7 +239,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

history := session.GetMessages()
events := runner.Run(ctx, msgops.NormalizeMessagesForModelInput(history), adk.WithCheckPointID(checkPointID))
result, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
result, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
CaptureInterrupt: true,
Expand All @@ -251,7 +251,7 @@ Always use absolute paths when calling filesystem tools.`, projectRoot, projectR

assistantText := result.AssistantText
if result.InterruptInfo != nil {
assistantText, err = handleInterrupt[M](ctx, runner, checkPointID, result.InterruptInfo, reader)
assistantText, err = handleInterrupt(ctx, runner, checkPointID, result.InterruptInfo, reader)
if err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down Expand Up @@ -414,7 +414,7 @@ func handleInterrupt[M adk.MessageType](ctx context.Context, runner *adk.TypedRu
return "", fmt.Errorf("failed to resume: %w", err)
}

resumeResult, err := helpers.PrintAndCollect[M](events, helpers.PrintOptions{
resumeResult, err := helpers.PrintAndCollect(events, helpers.PrintOptions{
ShowToolCalls: true,
ShowToolResults: true,
CaptureInterrupt: true,
Expand All @@ -424,7 +424,7 @@ func handleInterrupt[M adk.MessageType](ctx context.Context, runner *adk.TypedRu
}

if resumeResult.InterruptInfo != nil {
return handleInterrupt[M](ctx, runner, checkPointID, resumeResult.InterruptInfo, reader)
return handleInterrupt(ctx, runner, checkPointID, resumeResult.InterruptInfo, reader)
}

return resumeResult.AssistantText, nil
Expand Down
6 changes: 3 additions & 3 deletions quickstart/chatwitheino/cmd/ch10/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func runTyped[M adk.MessageType](ctx context.Context) {
log.Fatalf("build agent: %v", err)
}

runner := adk.NewTypedRunner[M](adk.TypedRunnerConfig[M]{
runner := adk.NewTypedRunner(adk.TypedRunnerConfig[M]{
Agent: agent,
EnableStreaming: true,
CheckPointStore: adkstore.NewInMemoryStore(),
Expand Down Expand Up @@ -497,7 +497,7 @@ func buildAgentTyped[M adk.MessageType](ctx context.Context) (adk.TypedResumable
return nil, err
}

ragTool, err := rag.BuildTool[M](ctx, cm)
ragTool, err := rag.BuildTool(ctx, cm)
if err != nil {
return nil, fmt.Errorf("build rag tool: %w", err)
}
Expand All @@ -522,7 +522,7 @@ func buildAgentTyped[M adk.MessageType](ctx context.Context) (adk.TypedResumable
},
}
helpers.ApplyMessageModelRetry(cfg)
return deep.NewTyped[M](ctx, cfg)
return deep.NewTyped(ctx, cfg)
}

// --- Middlewares ---
Expand Down
Loading