-
-
Notifications
You must be signed in to change notification settings - Fork 126
[AI Bundle][Ollama] Fix configuration when a custom http_client is set #917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ->setArguments([ | ||
| $platform['host_url'], | ||
| new Reference('http_client'), | ||
| new Reference($platform['http_client']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do that, we use the default HTTP Client.
And I have the following options:
ai:
platform:
ollama:
http_client: http_client.ollama
# Configured in the HTTP Client
# see https://github.com/symfony/ai/issues/899
host_url: ''
api_catalog: trueSo host_url is empty, so the underlying code will explode because the host URL is not a valid endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm right host_url can be omitted (as it fallback to http://127.0.0.1:11434 by default) 🤔
->arrayNode('ollama')
->children()
->stringNode('host_url')->defaultValue('http://127.0.0.1:11434')->end()
->stringNode('http_client')
->defaultValue('http_client')
->info('Service ID of the HTTP client to use')
->end()
->booleanNode('api_catalog')
->info('If set, the Ollama API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls')
->end()
->end()
->end()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if someone configure a custom host_url, without a custom HTTP client, the one in the configure must be used. So it cannot be omitted
|
Thank you @lyrixx. |
cc @Guikingone