katkode_ai_manager 0.0.3  katkode_ai_manager: ^0.0.3 copied to clipboard
katkode_ai_manager: ^0.0.3 copied to clipboard
A flutter library to let users use their own LLM keys to access AI models
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.