feat: add xAI handling and response processing

This commit is contained in:
CaIon
2025-04-10 17:20:59 +08:00
parent 8efa12b941
commit 8723e3f239
6 changed files with 137 additions and 9 deletions

View File

@@ -56,6 +56,9 @@ func StringData(c *gin.Context, str string) error {
}
func ObjectData(c *gin.Context, object interface{}) error {
if object == nil {
return errors.New("object is nil")
}
jsonData, err := json.Marshal(object)
if err != nil {
return fmt.Errorf("error marshalling object: %w", err)