mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-05 08:43:45 +08:00
refactor: 更改 OpenAI 请求 Body 数据结构,兼容函数调用请求
This commit is contained in:
@@ -81,3 +81,10 @@ func JsonEncode(value interface{}) string {
|
||||
func JsonDecode(src string, dest interface{}) error {
|
||||
return json.Unmarshal([]byte(src), dest)
|
||||
}
|
||||
|
||||
func InterfaceToString(value interface{}) string {
|
||||
if str, ok := value.(string); ok {
|
||||
return str
|
||||
}
|
||||
return JsonEncode(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user