This package provides AI models and schemas for the Commit Generator project. Currently, it supports models from OpenAI and Ollama.
To use the AI models and schemas in your project, install the package:
pnpm install @commit-generator/ai-models
After installation, you can use the AI models and schemas in your project.
- Using AI Models The available models are OpenAI and Ollama. To create an AI model, use the createAIModel function, specifying the provider and parameters:
import { createAIModel } from '@commit-generator/ai-models';
const provider = "openai"; // Available models: "openai" or "ollama"
const params = {
key: "some_key",
};
const model = createAIModel(provider, params);
const result = await model.complete("Hello");
console.log(result);
- Extending Schemas
import { aiModelSchemes, IAIModelSchemes } from '@commit-generator/ai-models/schemes';
console.log(aiModelSchemes.openai);
export type IType = {
myProperties: Array<string>
} & Partial<IAIModelSchemes>;
This package is licensed under the MIT License.