Package org.machanism.machai.ai


package org.machanism.machai.ai
Provides Machai's AI integration layer, including provider abstractions, provider implementations, provider lifecycle management, usage accounting, and function-tool metadata used during model-assisted workflows.

The package groups the application-facing components that allow Machai to communicate with generative AI services without binding callers directly to a specific vendor SDK. Higher-level code can resolve and configure providers, submit prompts or instructions, register callable tools, request embeddings, and inspect usage statistics through stable contracts.

Package responsibilities

  • org.machanism.machai.ai.provider defines the common provider API for text generation, embeddings, tool-aware execution, request logging, configuration, and provider delegation.
  • org.machanism.machai.ai.provider.impl contains concrete provider integrations for supported model backends, including OpenAI-compatible, Anthropic Claude, CodeMie, and tool-focused provider workflows.
  • org.machanism.machai.ai.manager coordinates provider selection, model resolution, and token or request usage tracking across generation operations.
  • org.machanism.machai.ai.tools defines annotations, descriptors, roles, prompt metadata, and loader utilities used to expose Java methods as model-callable function tools.

Typical usage

Clients generally obtain a configured generative AI provider through the manager layer, enrich it with prompts, instructions, optional file context, and annotated tools, then invoke the provider API to execute a generation or embedding request. The shared abstractions in this package keep those workflows consistent across supported backend providers while preserving access to usage information for accounting, diagnostics, and optimization.