Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Improve the style in the remote agent example (#210)

Jaana Dogan62ca1ba4707d
diff --git a/examples/remote_agent/main.go b/examples/remote_agent/main.go
index 9c29df3..d26c0ed 100644
--- a/examples/remote_agent/main.go
+++ b/examples/remote_agent/main.go
@@ -48,13 +48,13 @@ func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, pro
return err
}
- startMsg := incoming.GetStart()
- if startMsg == nil {
+ start := incoming.GetStart()
+ if start == nil {
continue // optionally wait for start
}
var messages []*proto.Message
- for _, input := range startMsg.Messages {
+ for _, input := range start.Messages {
textContent := input.GetContent().GetText()
if textContent == nil {
continue
@@ -68,14 +68,12 @@ func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, pro
// We don't need to uppercase the whole history.
// Only uppercase the last text message.
lastMsg := messages[len(messages)-1]
- responseText := strings.ToLower(lastMsg.GetContent().GetText().Text) // Preserving ToLower as in original code
-
responseMsg := &proto.Message{
Role: "assistant",
Content: &proto.Content{
Type: &proto.Content_Text{
Text: &proto.TextContent{
- Text: responseText,
+ Text: strings.ToLower(lastMsg.GetContent().GetText().Text),
},
},
},