AI Providers JSON Configuration Examples - XMPieLab/uStore-NG GitHub Wiki
AI Providers - JSON Configuration Examples
When configuring an AI provider in uStore, you supply a JSON body that defines the parameters and behavior for API requests. The model is configured separately in the provider settings and does not need to be included in the JSON body. uStore automatically injects the end user's prompt into the request at runtime - you do not need to include it in the configuration.
Note: AI provider APIs evolve frequently. The examples below are a starting point. Always refer to the provider's official documentation for the most current options and parameters.
OpenAI
Text Generation
The user's prompt is injected by uStore as a {"role": "user"} message at runtime.
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
}
],
"temperature": 0.7,
"max_completion_tokens": 500
}
Image Generation
The user's prompt is injected by uStore into the prompt field at runtime.
{
"size": "1024x1024",
"quality": "medium",
"n": 1
}
OpenAI Documentation
Google AI (Gemini)
Text Generation
The user's prompt is injected by uStore as a {"role": "user"} entry in contents at runtime.
{
"systemInstruction": {
"parts": [
{
"text": "You are a helpful assistant."
}
]
},
"generationConfig": {
"temperature": 0.7,
"maxOutputTokens": 500
}
}
Image Generation (Imagen)
The user's prompt is injected by uStore into instances at runtime.
{
"parameters": {
"sampleCount": 1,
"aspectRatio": "1:1"
}
}
Google AI Documentation
Custom Provider
Custom providers use the OpenAI-compatible JSON format. If your custom provider supports the OpenAI API standard (as many do), use the same JSON structure shown in the OpenAI section above.
Quick Reference: OpenAI vs. Google AI Structure
| Aspect | OpenAI | Google AI |
|---|---|---|
| System prompt | {"role": "system", "content": "..."} inside messages |
Separate "systemInstruction" field |
| Parameters | Top-level (e.g., "temperature": 0.7) |
Nested under "generationConfig" |
| Max tokens | "max_completion_tokens" |
"maxOutputTokens" |
| Image settings | "size", "quality", "n" |
"sampleCount", "aspectRatio" inside "parameters" |