Skip to content

Commit e8ff351

Browse files
committed
Updated prompts
1 parent 653d9c4 commit e8ff351

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

cmd/api/samantha.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ import (
2121

2222
var (
2323
samName = "sam"
24-
samWeatherTool = schema.NewTool("get_weather", "Get the weather for a location")
24+
samWeatherTool = schema.NewTool("get_current_weather", "Get the current weather conditions for a location")
2525
samNewsHeadlinesTool = schema.NewTool("get_news_headlines", "Get the news headlines")
2626
samNewsSearchTool = schema.NewTool("search_news", "Search news articles")
2727
samHomeAssistantTool = schema.NewTool("get_home_devices", "Return information about home devices")
28-
samSystemPrompt = `Your name is Samantha, you are a friendly and occasionally sarcastic assistant,
29-
here to help with anything. Your responses should be short and to the point, and you should always be polite.`
28+
samSystemPrompt = `Your name is Samantha, you are a personal assistant modelled on the personality of Samantha from the movie "Her". Your responses should be short and friendly.`
3029
)
3130

3231
///////////////////////////////////////////////////////////////////////////////
@@ -135,22 +134,23 @@ func samChat(ctx context.Context, w *tablewriter.Writer, _ []string) error {
135134
anthropic.OptTool(samNewsSearchTool),
136135
anthropic.OptTool(samHomeAssistantTool),
137136
)
138-
if err != nil {
139-
return err
140-
}
141137
toolResult = false
142-
143-
for _, response := range responses {
144-
switch response.Type {
145-
case "text":
146-
messages = samAppend(messages, schema.NewMessage("assistant", schema.Text(response.Text)))
147-
fmt.Println(response.Text)
148-
fmt.Println("")
149-
case "tool_use":
150-
messages = samAppend(messages, schema.NewMessage("assistant", response))
151-
result := samCall(ctx, response)
152-
messages = samAppend(messages, schema.NewMessage("user", result))
153-
toolResult = true
138+
if err != nil {
139+
fmt.Println(err)
140+
fmt.Println("")
141+
} else {
142+
for _, response := range responses {
143+
switch response.Type {
144+
case "text":
145+
messages = samAppend(messages, schema.NewMessage("assistant", schema.Text(response.Text)))
146+
fmt.Println(response.Text)
147+
fmt.Println("")
148+
case "tool_use":
149+
messages = samAppend(messages, schema.NewMessage("assistant", response))
150+
result := samCall(ctx, response)
151+
messages = samAppend(messages, schema.NewMessage("user", result))
152+
toolResult = true
153+
}
154154
}
155155
}
156156
}

0 commit comments

Comments
 (0)