Error response type #27
iamshimantadas
started this conversation in
General
Replies: 3 comments 4 replies
-
|
What do you mean with "try this code from the chatgpt response"? |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Can I use gemini api: https://docs.neuron-ai.dev/ I mean gemini api url and model. ?? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
The URL of your ollama server is wrong protected function provider(): AIProviderInterface
{
return new Ollama(
url: 'http://localhost:11434/api',
model: 'gemma3:1b',
);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi just make a try to your nuron ai php framework.
I do a simple code:
`<?php
namespace App\Agents;
require 'vendor/autoload.php';
use NeuronAI\Agent;
use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Ollama\Ollama;
class MyAgent extends Agent
{
public function provider(): AIProviderInterface
{
return new Ollama(
url: 'http://localhost:11434/api/generate',
model: 'gemma3:1b'
);
}
}
echo MyAgent::make()->chat(new UserMessage("Hi!"));`
==> IT throws an error: Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error:
POST http://localhost:11434/api/generate/chatresulted in a404 Not Foundresponse: 404 page not found in C:\xampp\htdocs\phpai\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:111 Stack trace: #0 C:\xampp\htdocs\phpai\vendor\guzzlehttp\guzzle\src\Middleware.php(72): and so on .......but when i try this code from the chatgpt response i see ----
`require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post('http://localhost:11434/api/generate', [
'json' => [
'model' => 'gemma:2b',
'prompt' => 'Hi!',
'stream' => false
]
]);
$body = json_decode((string) $response->getBody(), true);
echo $body['response'] ?? 'No response';`
==> it works fine! Error showing like we need to send POST request to it ??
i mean if yes then why ? your write the code in your docs .... https://docs.neuron-ai.dev/introduction ..... if somene just simply tries to do code he/she first time got an error!
Beta Was this translation helpful? Give feedback.
All reactions