Repository navigation
refactor: move the Groq files to the upstream layout - #302
Merged
eric8810 merged 8 commits intoOct 25, 2026
Merged
Conversation
One Rust file per @ai-sdk/groq source file (RFC-0046 §4.2): model.rs becomes chat_language_model.rs, convert.rs convert_to_chat_messages.rs, usage.rs convert_usage.rs, types.rs api_types.rs, finish_reason.rs map_finish_reason.rs, transcription.rs transcription_model.rs, and options.rs splits into chat_language_model_options.rs and transcription_model_options.rs. mod.rs keeps only the module list (index.ts); the provider is in provider.rs. The tests follow: tests/groq_test.rs splits by upstream test file into tests/it/groq/ (chat_language_model.rs, merged with the snapshot ports, convert_to_chat_messages.rs, convert_usage.rs and prepare_tools.rs) over a shared wiremock harness in support.rs, and tests/groq_transcription_test.rs moves to tests/it/groq/transcription_model.rs. The file-level modules the single binaries needed become the files themselves. Move only: the test count (253) and the test function names are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
The Groq test PR now keeps every vendor test in src/groq/tests/ (RFC-0046
§5): the source files lose their `mod tests;` and src/groq/mod.rs declares
the tests module once. This merge keeps the split source files of the move
and lays its tests out the same way:
- the five src/groq/tests/ files import from the renamed source files
(chat_language_model_options, convert_to_chat_messages, api_types,
convert_usage);
- tests/groq_test.rs, including the new usage_raw_keeps_null_fields case,
joins src/groq/tests/{chat_language_model,convert_to_chat_messages,
convert_usage,prepare_tools}.rs by describe block, its wiremock helpers
in src/groq/tests/support.rs;
- tests/groq_transcription_test.rs becomes
src/groq/tests/transcription_model.rs;
- tests/it/ is gone; boundary rule 8 matches the other move PRs.
Move only: 254 tests before and after, same names and describe paths.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
This was referenced Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
cunninghamcard-bit
marked this pull request as ready for review
October 24, 2026 11:21
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Contributor
Author
Generated by Claude Code |
7 of 13 tasks
The test branch reworked tests/groq_test.rs (fixtures read from src/groq/tests/fixtures, whole-value asserts, partial: markers) and groq_transcription_test.rs; each change goes to the case where the move put it (convert_to_chat_messages.rs, convert_usage.rs, prepare_tools.rs, chat_language_model.rs, transcription_model.rs, support.rs). The snapshot cases it added to chat_language_model.rs join the existing doGenerate and doStream text, tool_call, reasoning and raw-chunk modules, so each describe block stays one module. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Contributor
Author
核对:测试属性数和 Generated by Claude Code |
…s it is here Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Contributor
Author
Generated by Claude Code |
…s' into refactor/move-the-groq-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
eric8810
approved these changes
Oct 25, 2026
eric8810
left a comment
Contributor
There was a problem hiding this comment.
指向已改回 groq/convert_to_chat_messages.rs:88 与 deepseek/convert.rs:284;move-only、126→126、无 stale refs。Approve。
…s' into refactor/move-the-groq-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
eric8810
changed the base branch from
test/port-the-upstream-groq-tests
to
master
October 25, 2026 17:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
按 RFC-0046 §4.2、§5(#294)把 Groq 的文件按
@ai-sdk/groq逐个对应,做法和 Mistral(#297)、Cohere(#298)、DeepSeek(#300)、Hugging Face(#304)相同。叠在 #301(Groq 测试迁移)上。只挪不改:没有改任何函数体和断言,测试数前后都是 254,测试函数名和 describe 路径一致。测试按 10-20 定下的新布局全部放在src/groq/tests/。已经测试分支
bb8b5dd2合上 masterb69137eb,冲突按 master 的改动搬到新位置解决(错误改成 RFC-0047 的结构体变体和 cause,落到chat_language_model_options.rs、transcription_model_options.rs、provider.rs和tests/chat_language_model.rs);测试数前后仍相等(Groq 119 个,测试分支 lib 37 个加老测试程序 82 个,名字多重集相同)。一、体系概览:一次 Groq 调用经过哪些文件(#301 head
c2933999)测试:#301 的新用例在
src/groq/tests/(5 个文件,groq/mod.rs末尾#[cfg(test)] mod tests;);老用例还在 2 个独立测试程序tests/groq_test.rs(72 个)、tests/groq_transcription_test.rs(10 个)。二、本 PR 的改动(细节)
1. 源文件:去掉和目录重复的厂商前缀,kebab-case 换成 snake_case
layout.toml的rust字段同步改成新文件名(groq-api-types.ts指向api_types.rs,groq-config.ts指向provider.rs)。2. 测试都在
src/groq/tests/(RFC-0046 §5),一个上游测试文件一个 Rust 文件原来单个测试程序里有一层"上游文件名"的 mod(
groq_chat_language_model、convert_to_groq_chat_messages、groq_prepare_tools、groq_transcription_model),现在这一层就是文件本身,所以去掉;上游 describe 那几层不变(convert_groq_usage、prepare_tools是上游 describe 名,保留)。aimux_providers::改成crate::,browser_search_models.rs的include_str!路径跟着改。不再有tests/it/。Type of change
Checklist
cargo fmt --all -- --checkpassescargo +1.99 clippy -p aimux-providers --lib --tests -- -D warnings、cargo doc -D warningspasscargo test -p aimux-providers --lib groq:119 个全过scripts/check_provider_boundaries.shpasses(规则 8 和 refactor: move the Mistral files to the upstream layout #297、refactor: move the Hugging Face files to the upstream layout #304 同一版)Notes for reviewers
GroqChatLanguageModel、GroqTranscriptionModel、create_groq等照旧从aimux_providers::groq导出。tests/non_object_tool_input_test.rs第 10 行注释里的旧路径groq/convert.rs:88改成新路径;refactor: move the DeepSeek files to the upstream layout #300 改了同一行的 DeepSeek 路径,后合入的那个要合并这一行。共享进程状态:测试原来各自是单独的测试程序,现在并进 lib 的同一个测试程序。只有
the_key_is_read_from_the_environment_per_request_not_at_creation改GROQ_API_KEY,它带#[serial],结束时恢复原值;没有全局计数器和固定临时路径(RFC-0046 §5)。https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Generated by Claude Code