(conversationIDValue interface{})
| 293 | } |
| 294 | |
| 295 | func stringifyConversationID(conversationIDValue interface{}) (string, bool) { |
| 296 | switch v := conversationIDValue.(type) { |
| 297 | case string: |
| 298 | if strings.TrimSpace(v) == "" { |
| 299 | return "", false |
| 300 | } |
| 301 | return v, true |
| 302 | case float64: |
| 303 | return strconv.FormatInt(int64(v), 10), true |
| 304 | case int64: |
| 305 | return strconv.FormatInt(v, 10), true |
| 306 | default: |
| 307 | return "", false |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | func writeConversationNotFound(c *gin.Context) { |
| 312 | c.JSON(http.StatusNotFound, model.NotFound.ToOpenAIErrorRespone(errors.New("Conversation not found"))) |
no outgoing calls
no test coverage detected