| package types
|
|
|
| import (
|
| "errors"
|
| "strings"
|
| )
|
|
|
| const (
|
| MorphAPIURL = "https://www.morphllm.com/api/warpgrep-chat"
|
| LogDir = "./logs"
|
| )
|
|
|
| var MorphHeaders = map[string]string{
|
| "accept": "*/*",
|
| "accept-language": "zh-CN,zh;q=0.9",
|
| "cache-control": "no-cache",
|
| "content-type": "application/json",
|
| "origin": "https://www.morphllm.com",
|
| "pragma": "no-cache",
|
| "priority": "u=1, i",
|
| "referer": "https://www.morphllm.com/playground/na/warpgrep?repo=tiangolo%2Ffastapi",
|
| "sec-ch-ua": `"Not(A:Brand";v="8", "Chromium";v="144", "Google Chrome";v="144"`,
|
| "sec-ch-ua-mobile": "?0",
|
| "sec-ch-ua-platform": `"macOS"`,
|
| "sec-fetch-dest": "empty",
|
| "sec-fetch-mode": "cors",
|
| "sec-fetch-site": "same-origin",
|
| "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
|
| }
|
|
|
| var DebugMode = true
|
|
|
|
|
|
|
| var CookieRotatorInstance interface {
|
| NextCookie() (cookie interface{}, err error)
|
| MarkUsed(cookieID uint) error
|
| MarkError(cookieID uint) error
|
| }
|
|
|
|
|
|
|
| func GetNextCookieFromRotator() (interface{}, error) {
|
| if CookieRotatorInstance == nil {
|
| return nil, errors.New("cookie rotator not initialized")
|
| }
|
| return CookieRotatorInstance.NextCookie()
|
| }
|
|
|
| type ParsedToolCall struct {
|
| Name string `json:"name"`
|
| Input map[string]interface{} `json:"input"`
|
| }
|
|
|
|
|
|
|
|
|
| const DefaultModel = "claude-opus-4-5-20251101"
|
|
|
|
|
| var SupportedModels = []string{
|
| "claude-opus-4-5-20251101",
|
| }
|
|
|
|
|
| func IsModelSupported(model string) bool {
|
| if model == "" {
|
| return false
|
| }
|
| for _, supported := range SupportedModels {
|
| if strings.EqualFold(supported, model) {
|
| return true
|
| }
|
| }
|
| return false
|
| }
|
|
|
|
|
|
|
|
|
| type ChangePasswordRequest struct {
|
| OldPassword string `json:"old_password" binding:"required"`
|
| NewPassword string `json:"new_password" binding:"required,min=6"`
|
| }
|
|
|