Skip to content
Open
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
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,68 @@ echo $message->getContent();
// Hi, how can I help you today?
```
{% endtab %}

{% tab title="ZAI" %}
```php
namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\ZAI\ZAI;

class MyAgent extends Agent
{
protected function provider(): AIProviderInterface
{
return new ZAI(
key: 'ZAI_API_KEY',
model: 'glm-5',
parameters: [], // Add custom params (temperature, logprobs, etc)
);
}
}

$message = MyAgent::make()
->chat(new UserMessage("Hi!"))
->getMessage();

echo $message->getContent();
// Hi, how can I help you today?
```
{% endtab %}

{% tab title="Deepseek" %}
```php
namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Deepseek\Deepseek;

class MyAgent extends Agent
{
protected function provider(): AIProviderInterface
{
return new Deepseek(
key: 'DEEPSEEK_API_KEY',
model: 'DEEPSEEK_MODEL',
parameters: [], // Add custom params (temperature, logprobs, etc)
strict_response: false, // Strict structured output
);
}
}

$message = MyAgent::make()
->chat(new UserMessage("Hi!"))
->getMessage();

echo $message->getContent();
// Hi, how can I help you today?
```
{% endtab %}

{% endtabs %}

Check out all the supported providers in the [AI Provider](providers/ai-provider.md) section.
Expand Down