···7575 Type: "boolean",
7676 Description: "Whether the reply to the parent is bad faith or not.",
7777 },
7878+ "off_topic": {
7979+ Type: "boolean",
8080+ Description: "Whether the reply to the parent is off topic.",
8181+ },
8282+ "funny": {
8383+ Type: "boolean",
8484+ Description: "Whether the reply to the parent is funny.",
8585+ },
7886 },
7979- Required: []string{"bad_faith"},
8787+ Required: []string{"bad_faith", "off_topic", "funny"},
8088 }
8189)
8290···124132 return &chatResp, nil
125133}
126134127127-func (c *LMStudioClient) GetIsBadFaith(ctx context.Context, parent, reply string) (bool, error) {
135135+type BadFaithResults struct {
136136+ BadFaith bool
137137+ OffTopic bool
138138+ Funny bool
139139+}
140140+141141+func (c *LMStudioClient) GetIsBadFaith(ctx context.Context, parent, reply string) (*BadFaithResults, error) {
128142 request := ChatRequest{
129143 Model: "google/gemma-3-27b",
130144 Messages: []Message{
131145 {
132146 Role: "system",
133133- Content: "You are an observer of posts on a microblogging website. You determine if the second message provided by the user is a bad faith reply to the second message provided to you. Opposing viewpoints are good, and should be appreciated. However, things that are toxic, trollish, or offer no good value to the conversation are considered bad faith.",
147147+ Content: "You are an observer of posts on a microblogging website. You determine if the second message provided by the user is a bad faith reply, and off topic reply, and/or a funny reply to the second message provided to you. Opposing viewpoints are good, and should be appreciated. However, things that are toxic, trollish, or offer no good value to the conversation are considered bad faith. Just because something is bad faith or off topic does not mean the post cannot also be funny.",
134148 },
135149 {
136150 Role: "user",
···142156 },
143157 },
144158 Temperature: 0.7,
145145- MaxTokens: 50,
159159+ MaxTokens: 100,
146160 ResponseFormat: &ResponseFormat{
147161 Type: "json_schema",
148162 JSONSchema: &JSONSchemaWrap{
···154168 }
155169 response, err := c.sendChatRequest(request)
156170 if err != nil {
157157- return false, fmt.Errorf("failed to get chat response: %w", err)
171171+ return nil, fmt.Errorf("failed to get chat response: %w", err)
158172 }
159173160174 var result map[string]any
161175 if err := json.Unmarshal([]byte(response.Choices[0].Message.Content), &result); err != nil {
162162- return false, fmt.Errorf("failed to unmarshal response: %w", err)
176176+ return nil, fmt.Errorf("failed to unmarshal response: %w", err)
163177 }
164178165179 badFaith, ok := result["bad_faith"].(bool)
166180 if !ok {
167167- return false, fmt.Errorf("model gave bad response, not structured")
181181+ return nil, fmt.Errorf("model gave bad response (bad faith), not structured")
168182 }
169183170170- return badFaith, nil
184184+ offTopic, ok := result["off_topic"].(bool)
185185+ if !ok {
186186+ return nil, fmt.Errorf("model gave bad response (off topic), not structured")
187187+ }
188188+189189+ funny, ok := result["funny"].(bool)
190190+ if !ok {
191191+ return nil, fmt.Errorf("model gave bad response (funny), not structured")
192192+ }
193193+194194+ return &BadFaithResults{
195195+ BadFaith: badFaith,
196196+ OffTopic: offTopic,
197197+ Funny: funny,
198198+ }, nil
171199}