-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (31 loc) · 910 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"encoding/json"
)
func GetCurrentConversation(debateID string) (string) {
result := GetDebateHistory(debateID)
jsonBytes, err := json.Marshal(result)
if err != nil {
return "[]"
}
return string(jsonBytes)
}
type DebateResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
}
func StartDebate(debateID, model1, model2, persona1, persona2, debateTopic string) DebateResponse {
_= RegisterDebate(debateID, model1, model2, persona1, persona2, debateTopic)
_, err := runDebate(debateID, model1, model2, persona1, persona2, debateTopic)
if err != nil {
return DebateResponse{
Success: false,
Message: fmt.Sprintf("Error running debate: %v", err),
}
}
return DebateResponse{
Success: true,
Message: "Debate completed successfully",
}
}