Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/guide/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The search box filters providers by name; the query is case-insensitive. When no

## Add Provider

When adding a provider, you can first select a built-in template. Templates pre-fill the provider name, protocol-corresponding default address, API path, and some example models; these can still be modified before saving. Current templates include OpenAI, OpenAI Responses, DeepSeek, Qwen DashScope, Kimi, OpenRouter, SiliconFlow, Ollama, Google, and Claude.
When adding a provider, you can first select a built-in template. Templates pre-fill the provider name, protocol-corresponding default address, API path, and some example models; these can still be modified before saving. Current templates include OpenAI, OpenAI Responses, DeepSeek, Qwen DashScope, Kimi, OpenRouter, Requesty, SiliconFlow, Ollama, Google, and Claude.

The add form includes:

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## 添加供应商

添加供应商时可以先选择内置模板。模板会预填供应商名称、协议对应的默认地址、API 路径和部分示例模型,保存前仍可以修改这些内容。当前模板包括 OpenAI、OpenAI Responses、DeepSeek、Qwen DashScope、Kimi、OpenRouter、SiliconFlow、Ollama、Google 和 Claude。
添加供应商时可以先选择内置模板。模板会预填供应商名称、协议对应的默认地址、API 路径和部分示例模型,保存前仍可以修改这些内容。当前模板包括 OpenAI、OpenAI Responses、DeepSeek、Qwen DashScope、Kimi、OpenRouter、Requesty、SiliconFlow、Ollama、Google 和 Claude。

添加表单包含:

Expand Down
24 changes: 24 additions & 0 deletions spring_note/lib/core/models/provider_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ProviderConfig {
'Qwen DashScope',
'Kimi',
'OpenRouter',
'Requesty',
'SiliconFlow',
'Ollama',
'Google',
Expand Down Expand Up @@ -190,6 +191,29 @@ class ProviderConfig {
],
);
}
if (normalized == 'requesty') {
return ProviderConfig(
id: _makeId('Requesty'),
enabled: true,
name: 'Requesty',
protocol: 'openaiCompatible',
apiKey: '',
baseUrl: 'https://router.requesty.ai/v1',
apiPath: '/chat/completions',
models: const [
ModelConfig(
modelId: 'openai/gpt-4.1-mini',
displayName: 'GPT-4.1 Mini',
inputModes: ['text', 'image'],
),
ModelConfig(
modelId: 'anthropic/claude-sonnet-4-5',
displayName: 'Claude Sonnet 4.5',
inputModes: ['text', 'image'],
),
],
);
}
if (normalized == 'siliconflow') {
return ProviderConfig(
id: _makeId('SiliconFlow'),
Expand Down
16 changes: 16 additions & 0 deletions spring_note/test/ai_client_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,22 @@ void main() {
expect(deepSeek.models.first.inputModes, isNot(contains('image')));
});

test('requesty template uses the openai compatible router endpoint', () {
expect(ProviderConfig.templateNames, contains('Requesty'));

final requesty = ProviderConfig.template('Requesty');
expect(requesty.name, 'Requesty');
expect(requesty.protocol, 'openaiCompatible');
expect(requesty.baseUrl, 'https://router.requesty.ai/v1');
expect(requesty.apiPath, '/chat/completions');
expect(requesty.enabled, isTrue);
expect(requesty.apiKey, isEmpty);
expect(requesty.models.map((model) => model.modelId), [
'openai/gpt-4.1-mini',
'anthropic/claude-sonnet-4-5',
]);
});

test('memory sanitizer preserves complete tool call chains', () {
final messages = [
MemoryMessage(
Expand Down
Loading