[Feature] Request: Add API key configuration to local provider
Hi, there. I am currently using an Ollama service that's shared within a local area network (LAN) and requires API key authentication. However, I've encountered an issue where I cannot configure this API key in the Ollama provider section of the Void Settings interface. Would it be possible to add API key support to the Ollama provider configuration options? This feature would greatly improve the service's security and usability in shared network environments.
Thanks for the suggestion. Right now you should be able to use OpenAI-Compatible with localhost:11434 for Ollama if you need an API key configuration. Will consider adding an additional api key field for Ollama too.
Environment:
- Operating System: macos 15.4.1 (24E263)
- Void Version: Latest version
Problem Description:
In Void, after configuring the AI feature's "OpenAI-Compatible" part, attempting to send messages in the chat window results in a 400 Bad Request error with the message indicating that contents.parts must not be empty. This prevents the AI chat functionality from working correctly.
Steps to Reproduce:
- Open Void's settings (
Void's Settings). - Navigate to the AI feature configuration section, find and expand the "OpenAI-Compatible" settings.
- In the provided API Address and API Key fields, enter a valid API address and corresponding API key for a service provider that is compatible with the OpenAI API protocol.
- API Address example: [My address is compatible with the OpenAI API format.]
- API Key: [*]
- Save settings and close the settings window.
- Open the AI chat window.
- Type any text message (e.g., "Hello") in the chat input field and send it.
Expected Behavior:
The AI should receive the user's message and return a relevant response based on the configured API service.
Actual Behavior:
After sending the message, a red error notification box appears at the bottom of the chat window, displaying a 400 Bad Request error with the detailed message:
Error: 400 * GenerateContentRequest.contents[0].parts: contents.parts must not be empty.
* GenerateContentRequest.contents[1].parts: contents.parts must not be empty. * GenerateContentRequest.contents[2].parts: contents.parts must not be empty. (request id: [This is the request ID from the error message, e.g., 20250512080434472138378VKttiLm0])
Relevant Configuration:
The issue occurs when configuring and using the "OpenAI-Compatible" setting in Void. The API URL and a valid API Key were correctly filled in as per the service provider's requirements.
Potential Cause Analysis (based on error message):
Based on the error message GenerateContentRequest.contents[X].parts: contents.parts must not be empty., it is suspected that when Void constructs the request sent to the configured OpenAI-compatible API service, the contents.parts field, which is used to pass user message content, is not being correctly populated or formatted. This leads to an invalid request body and the server returning a 400 error. This might indicate an issue with how Void handles message content when interacting with this specific API endpoint type.