mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
move the example provider into the crate
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "deepseek",
|
||||
"engine": "openai",
|
||||
"display_name": "DeepSeek",
|
||||
"description": "Custom DeepSeek provider",
|
||||
"api_key_env": "DEEPSEEK_API_KEY",
|
||||
"base_url": "https://api.deepseek.com",
|
||||
"models": [
|
||||
{
|
||||
"name": "deepseek-chat",
|
||||
"context_limit": 128000,
|
||||
"input_token_cost": null,
|
||||
"output_token_cost": null,
|
||||
"currency": null,
|
||||
"supports_cache_control": null
|
||||
},
|
||||
{
|
||||
"name": "deepseek-reasoner",
|
||||
"context_limit": 128000,
|
||||
"input_token_cost": null,
|
||||
"output_token_cost": null,
|
||||
"currency": null,
|
||||
"supports_cache_control": null
|
||||
}
|
||||
],
|
||||
"headers": null,
|
||||
"timeout_seconds": null,
|
||||
"preserves_thinking": true,
|
||||
"supports_streaming": true
|
||||
}
|
||||
@@ -16,8 +16,7 @@ from aaif_goose import ( # noqa: E402
|
||||
|
||||
|
||||
def main() -> None:
|
||||
provider_json = (HERE.parent.parent.parent / "goose-providers" / "examples" / "deepseek.json").read_text()
|
||||
provider = DeclarativeProvider.from_json(provider_json)
|
||||
provider = DeclarativeProvider.from_json((HERE.parent / "deepseek.json").read_text())
|
||||
model = ProviderModelConfig(model_name="deepseek-v4-flash")
|
||||
messages = [ProviderMessage(role=MessageRole.USER, text="what is the capital of France?")]
|
||||
stream = provider.stream(
|
||||
@@ -26,7 +25,6 @@ def main() -> None:
|
||||
messages,
|
||||
)
|
||||
|
||||
print(f"{provider.name()}:")
|
||||
while chunk := stream.next():
|
||||
if chunk.text:
|
||||
print(chunk.text, end="")
|
||||
|
||||
Reference in New Issue
Block a user