diff --git a/README.md b/README.md index bc8570a..3c7bda2 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,24 @@ Transformers allow you to modify the request and response payloads to ensure com - `Anthropic`:If you use only the `Anthropic` transformer, it will preserve the original request and response parameters(you can use it to connect directly to an Anthropic endpoint). - `deepseek`: Adapts requests/responses for DeepSeek API. - `gemini`: Adapts requests/responses for Gemini API. -- `openrouter`: Adapts requests/responses for OpenRouter API. +- `openrouter`: Adapts requests/responses for OpenRouter API. It can also accept a `provider` routing parameter to specify which underlying providers OpenRouter should use. For more details, refer to the [OpenRouter documentation](https://openrouter.ai/docs/features/provider-routing). See an example below: + ```json + "transformer": { + "use": ["openrouter"], + "moonshotai/kimi-k2": { + "use": [ + [ + "openrouter", + { + "provider": { + "only": ["moonshotai/fp8"] + } + } + ] + ] + } + } + ``` - `groq`: Adapts requests/responses for groq API. - `maxtoken`: Sets a specific `max_tokens` value. - `tooluse`: Optimizes tool usage for certain models via `tool_choice`. diff --git a/README_zh.md b/README_zh.md index 600299e..679eee3 100644 --- a/README_zh.md +++ b/README_zh.md @@ -255,7 +255,24 @@ Transformers 允许您修改请求和响应负载,以确保与不同提供商 - `Anthropic`: 如果你只使用这一个转换器,则会直接透传请求和响应(你可以用它来接入其他支持Anthropic端点的服务商)。 - `deepseek`: 适配 DeepSeek API 的请求/响应。 - `gemini`: 适配 Gemini API 的请求/响应。 -- `openrouter`: 适配 OpenRouter API 的请求/响应。 +- `openrouter`: 适配 OpenRouter API 的请求/响应。它还可以接受一个 `provider` 路由参数,以指定 OpenRouter 应使用哪些底层提供商。有关更多详细信息,请参阅 [OpenRouter 文档](https://openrouter.ai/docs/features/provider-routing)。请参阅下面的示例: + ```json + "transformer": { + "use": ["openrouter"], + "moonshotai/kimi-k2": { + "use": [ + [ + "openrouter", + { + "provider": { + "only": ["moonshotai/fp8"] + } + } + ] + ] + } + } + ``` - `groq`: 适配 groq API 的请求/响应 - `maxtoken`: 设置特定的 `max_tokens` 值。 - `tooluse`: 优化某些模型的工具使用(通过`tool_choice`参数)。