feat: add xAI handling and response processing

This commit is contained in:
CaIon
2025-04-10 17:20:59 +08:00
parent b40bf7c812
commit 60a9bd45c6
6 changed files with 137 additions and 9 deletions
+3
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)