Allow to initiate new conversations

This commit is contained in:
mudler
2024-04-06 16:08:04 +02:00
parent 90fd130e31
commit 84c56f6c3e
4 changed files with 101 additions and 9 deletions

35
action/newconversation.go Normal file
View File

@@ -0,0 +1,35 @@
package action
import (
"github.com/sashabaranov/go-openai/jsonschema"
)
const ConversationActionName = "new_conversation"
func NewConversation() *ConversationAction {
return &ConversationAction{}
}
type ConversationAction struct{}
type ConversationActionResponse struct {
Message string `json:"message"`
}
func (a *ConversationAction) Run(ActionParams) (string, error) {
return "no-op", nil
}
func (a *ConversationAction) Definition() ActionDefinition {
return ActionDefinition{
Name: ConversationActionName,
Description: "Use this tool to initiate a new conversation or to notify something.",
Properties: map[string]jsonschema.Definition{
"message": {
Type: jsonschema.String,
Description: "The message to start the conversation",
},
},
Required: []string{"message"},
}
}