Commit Graph
48 Commits
Author SHA1 Message Date
Chenyme 7ffb185951 fix: retry error 2025-12-17 00:43:44 +08:00
Chenyme 22d8fb9af9 feat: more retry & proxy pool 2025-12-17 00:29:51 +08:00
Chenyme 1ddec29ffb feat: optimize concurrency limit 2025-12-16 17:38:15 +08:00
Chenyme 23acbb9bb2 Merge branch 'main' of https://github.com/chenyme/grok2api 2025-12-16 16:40:39 +08:00
Chenyme 3aef4347d7 fix: automatically disable token expiration 2025-12-16 16:40:32 +08:00
itismygoandClaude Sonnet 4.5 eff701c485 fix: 修复 grok-imagine-0.9 同时支持文生图和图生视频
- 恢复 is_video_model: True 以支持视频生成
- 更新模型描述说明支持两种模式
- 保留空列表安全访问修复

根据 xAI 官方文档,grok-imagine-0.9 支持:
1. 文本 → 图片 (text-to-image)
2. 图片 + 文本 → 视频 (image-to-video)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 04:14:01 +00:00
itismygo 300b03fdde fix: 修复 grok-imagine-0.9 纯文本生成图片的bug
## 问题描述
当使用 grok-imagine-0.9 模型进行纯文本到图片生成时,会抛出 "list index out of range" 错误。

## 根本原因
1. **模型配置错误**: grok-imagine-0.9 被错误地标记为视频模型 (`is_video_model: True`)
2. **数组访问bug**: 在没有图片附件时,代码尝试访问空列表的第一个元素 `payload.get("fileAttachments", [""])[0]`

## 修复内容

### app/models/grok_models.py
- 将 `is_video_model` 从 `True` 改为 `False`
- 更新 description 为 "Image generation model powered by Grok"

### app/services/grok/client.py
- 修复空列表访问bug,使用安全的访问方式:
  ```python
  file_attachments = payload.get("fileAttachments", [])
  ref_id = post_id or (file_attachments[0] if file_attachments else "")
  ```

## 测试结果
✅ 纯文本生成图片:成功
✅ 文本对话:正常
✅ 其他模型:不受影响

## 相关信息
根据 xAI 官方文档,Grok Imagine 主要是图像生成模型(使用 Aurora 引擎),支持 text-to-image 功能。
2025-12-12 02:26:29 +00:00
Chenyme 93dc1f16a4 merge: pull request #62 from bloodycrownD/patch-1
fix: index assignment in OpenAIChatCompletionChunkChoice
2025-11-22 13:58:36 +08:00
Chenyme 1a16748abd fix: delete the "chunk_index" 2025-11-22 13:57:22 +08:00
bloodycrownD aa02c32fa1 Fix index assignment in OpenAIChatCompletionChunkChoice 2025-11-22 00:50:26 +08:00
Zhi YangandClaude 685c2b576e fix: use Redis.from_url() for proper SSL support
Replace custom _parse_url() with redis.Redis.from_url() which properly
handles rediss:// SSL connections and all URL parameters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 14:58:24 +00:00
Chenyme 6599b1b283 feat: adjust the count display 2025-11-21 00:41:30 +08:00
Chenyme db73406dae feat: review python code & optimize code structure 2025-11-20 17:15:02 +08:00
Chenyme 0c6c36f999 fix: docker volume missing setting.toml 2025-11-20 14:07:34 +08:00
Chenyme 9df0ba5e11 fix: corrected parameters of the grok-4.1-thinking model 2025-11-18 10:09:17 +08:00
Chenyme eeb4f7120d feat: support new model grok 4.1 2025-11-18 09:50:07 +08:00
tdh 5668fd8b61 fix: correct base64 string validation logic 2025-11-15 06:00:49 +08:00
Chenyme e8485c37a1 feat: improve some error message details 2025-10-29 00:09:13 +08:00
Chenyme 351d8bf4fe feat: support dynamic headers 2025-10-28 21:41:31 +08:00
Chenyme b5b817ebcd feat: optimize logging and fix timeout calculation issues 2025-10-28 20:41:28 +08:00
Chenyme 78de3c7479 chore: integrate into existing architecture 2025-10-28 14:41:28 +08:00
yyg-max 275e7bb4b4 video 2025-10-28 13:54:37 +08:00
Chenyme 23b1cf574d feat: support not show think 2025-10-23 08:28:37 +08:00
Chenyme 63f5e378fd fix: don't show again cf_clearance 2025-10-22 20:58:31 +08:00
Chenyme 16aa0122cf feat: support test SSO 2025-10-22 17:32:16 +08:00
Chenyme 5059890b54 feat: support SSO tags 2025-10-22 16:16:19 +08:00
Chenyme a2c311883d feat: support cache proxy url 2025-10-17 16:24:11 +08:00
Chenyme 09453e71b9 feat: add automatic retry mechanism 2025-10-17 13:42:08 +08:00
Chenyme df32f6f1c6 feat: change the file directory and support authentication 2025-10-17 10:56:06 +08:00
JimmyTinsley c178b988c3 docs: fix tool description 2025-10-16 18:58:02 +08:00
JimmyTinsley 6085d9ff15 feat: implement MCP server and ask_grok tool for Grok AI interactions 2025-10-16 18:55:07 +08:00
Chenyme 8255d0b323 feat: use socks5h proxy 2025-10-16 13:33:45 +08:00
Chenyme bb945854db feat: support the redis 2025-10-15 17:29:47 +08:00
Chenyme f612156e8e feat: support the mysql 2025-10-15 14:50:56 +08:00
Chenyme 3f3e26401e fix: miss content field & function 2025-10-15 09:41:50 +08:00
Chenyme 1588c14987 feat: update response format 2025-10-15 09:08:20 +08:00
Chenyme b7331fd8b5 fix: chunk too big 2025-10-15 01:38:55 +08:00
Chenyme 743fa35117 feat: support use base64 2025-10-15 01:23:58 +08:00
Chenyme cb6e4656d5 fix: logger error 2025-10-14 10:56:52 +08:00
Chenyme fe0103ab64 feat: add timeout mechanism 2025-10-14 10:44:41 +08:00
Chenyme 90a11df85d fix: proxy exception repair 2025-10-14 10:07:01 +08:00
Chenyme f0bafb6a3b fix: repetitive video generation progress 2025-10-14 02:32:28 +08:00
Chenyme d03c3af93b fix: repetitive video generation progress 2025-10-14 02:26:56 +08:00
Chenyme 93d29d0f8f feat: add grok imagine 0.9 2025-10-14 01:55:16 +08:00
Chenyme 07e9682716 feat: support grok video generation 2025-10-14 01:46:50 +08:00
Chenyme e468870c7b feat: optimizing concurrent performance 2025-10-11 11:07:56 +08:00
Chenyme 610709f146 feat: optimizing concurrent performance 2025-10-11 10:08:05 +08:00
Chenyme ba617455f0 release: the first version 2025-10-10 16:59:56 +08:00