AI Provider
Interact with LLM providers or extend the framework to implement new ones.
Anthropic
namespace App\Neuron;
use NeuronAI\Agent;
use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;
use NeuronAI\Providers\HttpClientOptions;
class MyAgent extends Agent
{
protected function provider(): AIProviderInterface
{
return new Anthropic(
key: 'ANTHROPIC_API_KEY',
model: 'ANTHROPIC_MODEL',
parameters: [], // Add custom params (temperature, logprobs, etc)
httpOptions: new HttpClientOptions(timeout: 30),
);
}
}
$response = MyAgent::make()->chat(new UserMessage("Hi!"));
echo $response->getContent();
// Hi, how can I help you today?OpenAIResponses
OpenAI
AzureOpenAI
OpenAILike
Ollama
Gemini
Gemini Vertex AI
Mistral
HuggingFace
Deepseek
Grok (X-AI)
AWS Bedrock Runtime
Custom Http Options
Implement a custom provider
Last updated