Package org.machanism.machai.ai.provider.codemie


package org.machanism.machai.ai.provider.codemie
Provides CodeMie-backed AI provider integration for the MachAI application.

This package contains the CodeMie provider implementation that authenticates against the EPAM CodeMie OpenID Connect token endpoint, retrieves OAuth 2.0 access tokens, and adapts CodeMie-hosted model endpoints to the application's common Genai abstraction.

The package supports routing requests to OpenAI-compatible and Anthropic-compatible clients depending on the configured chat model. During initialization, it resolves the appropriate authentication flow, acquires an access token lazily, and injects the resulting credentials and base URLs into the delegated provider configuration.

Supported responsibilities

  • Resolve CodeMie authentication settings from application configuration.
  • Choose between password grant and client credentials grant token requests.
  • Expose CodeMie endpoints through provider implementations used elsewhere in the application.
  • Bridge CodeMie access tokens into OpenAI-compatible or Anthropic-compatible clients.

Relevant configuration properties

  • GENAI_USERNAME: user e-mail address or client identifier.
  • GENAI_PASSWORD: password or client secret.
  • chatModel: determines which downstream provider implementation is used.
  • AUTH_URL: optional override for the default CodeMie token endpoint.