Commit Graph
109 Commits
Author SHA1 Message Date
piexian 41d5a8d48f feat: 添加 NSFW 启用功能、Token 筛选标签页及修复 use_count 统计
新增功能:
- 添加 gRPC-Web 协议工具用于 NSFW API 调用
- 添加批量执行工具支持并发控制
- 添加 NSFW 服务及管理 API 端点 POST /api/v1/admin/tokens/nsfw/enable
- 添加 Token 状态筛选标签页(全部/正常/限流/失效)支持 ARIA 无障碍
- 添加批量启用 NSFW 按钮到 Token 管理工具栏

缺陷修复:
- 修复 use_count 统计:在 chat/video/image 完成后调用 consume()
- 修复 use_count 计算:使用 actual_cost 替代 cost 避免过度计数
- 修复 toggleSelectAll 仅选择当前筛选结果

配置变更:
- 添加 NSFW 相关配置项到 config.defaults.toml
2026-02-03 08:00:45 +08:00
Chenyme 66fd816fe1 fix: image and video download stream errors 2026-02-02 23:41:49 +08:00
Chenyme af5b0c3408 feat: add MIT license 2026-02-02 22:23:44 +08:00
Chenyme 4ad7332080 feat: add get models api 2026-02-02 22:21:04 +08:00
Chenyme 4fabe58bf9 docs: update README.md 2026-02-02 21:58:49 +08:00
Chenyme b622970c15 fix: correcting the Workflows table of contents 2026-02-02 21:21:09 +08:00
Chenyme 26bfc5e2e5 Merge pull request #102 from chenyme/refactor
Refactor: project overall architecture and logic
2026-02-02 21:17:36 +08:00
Chenyme 94582265c1 feat: optimize initialization services and configurations 2026-02-02 21:16:50 +08:00
Chenyme 1dbe5d2525 refactor: project overall architecture and logic 2026-02-02 14:48:54 +08:00
Chenyme eb5abc8b02 Merge pull request #79 from d7185540/main
修复代理问题
2025-12-25 16:03:06 +08:00
dmx 30769545cd Fix proxy normalization and pool handling 2025-12-22 01:24:50 +08:00
Chenyme 318f615a02 feat: update docker-entrypoint.sh 2025-12-19 11:51:52 +08:00
Chenyme abfb045e3b Merge pull request #18 from BiFangKNT/main
build: 添加 Python 3.13 版本配置和项目依赖文件
2025-12-19 11:49:10 +08:00
bifangknt 7330b10ae1 build: 更新 grok2api 依赖版本至 1.4.3 2025-12-19 11:45:37 +08:00
bifangknt 89a758d963 build: 更新项目依赖和版本号至1.4.3
添加uvloop、portalocker等新依赖以增强功能
更新cryptography、orjson等安全相关依赖
2025-12-19 11:42:50 +08:00
Chenyme 8fb9d04ff6 feat: compatible with Windows system 2025-12-19 11:33:25 +08:00
彼方 7ea8b7c19a Merge branch 'chenyme:main' into main 2025-12-19 11:04:41 +08:00
Chenyme 2385ec8eef Merge pull request #76 from chenyme/retry
Retry
2025-12-19 10:50:13 +08:00
Chenyme 7ffb185951 fix: retry error 2025-12-17 00:43:44 +08:00
Chenyme a2d59860a9 Update setting.toml 2025-12-17 00:29:57 +08:00
Chenyme 22d8fb9af9 feat: more retry & proxy pool 2025-12-17 00:29:51 +08:00
Chenyme 6ae39351a0 Merge pull request #75 from chenyme/concurrency
feat: optimize concurrency limit
2025-12-16 17:43:34 +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
Chenyme 173638406a Merge pull request #73 from itismygo/fix-imagine-image-generation
fix: 修复 grok-imagine-0.9 同时支持文生图和图生视频
2025-12-16 16:34:03 +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 cd72db567a fix: include setting.toml in Docker image to prevent first-run failure 2025-11-22 14:05:15 +08: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
Chenyme 8d24d2695f Merge: pull request #61 from FakerL/main
fix: use Redis.from_url() for proper SSL support
2025-11-22 13:49:13 +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 6b215945d3 fix: add orjson 3.11.4 requirements 2025-11-20 17:22:25 +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 7191a59097 docs: update readme.md 2025-11-18 10:22:12 +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
Chenyme e7081ffa4b Merge pull request #54 from tdh62/main
fix: correct base64 string validation logic
2025-11-18 09:10:18 +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 b9c67f972a Merge pull request #39 from yyg-max/main
feat: Support video
2025-10-28 14:42:50 +08:00
Chenyme 080c69011d Merge branch 'main' into main 2025-10-28 14:42:34 +08:00
Chenyme 78de3c7479 chore: integrate into existing architecture 2025-10-28 14:41:28 +08:00
Chenyme 48e3705911 feat: optimizing the request body 2025-10-28 14:30:28 +08:00