katkode_ai_manager
A flutter library to let users use their own LLM keys to access AI models
Sponsors
Consider supporting this project by becoming a sponsor. Your logo will show up here with a link to your website.
How to use
To use this plugin, add katkode_ai_manager as a dependency in your pubspec.yaml file.
Add a new model to the store:
AIModel aiModel = await ManagerAI.createAIModel(
AiModelType.gemini,
"xxx",
);
bool testResult = await aiModel.testModel();
if (testResult) {
await ManagerAI.addModel(aiModel);
// Success
} else {
// Fail
}
To use the model:
AIModel? aiModel = await ManagerAI.getDefaultModel();
String? aiResponse = await aiModel.getTextAndDocumentCompletion(
"This is an exmaple prompt",
[], // file bytes list
);
How it works
Uses the LLM API to access the AI models.
FAQ
How do I add additional AI model types?
Send a pull request with the new AI model and the corresponding test.
Libraries
- katkode_ai_manager
- models/ai_model
- models/ai_model_type
- models/ai_status
- models/gemini_ai
- screens/page_add_ai_model/page_add_ai_model
- services/keyboard_overlay
- services/manager_ai
- services/manager_ai_database
- services/manager_dialog
- services/manager_routing
- utilities/constants
- utilities/utils_common
- widgets/card_ai_model
- widgets/dialog_ai_models
- widgets/dialog_done
- widgets/dialog_get_apikey
- widgets/dialog_loading
- widgets/error_dialog