dotCMS / dotCMS/core

Adopt @ai-sdk/openai-compatible in microservice-accessability to use dotCMS as a model provider

Open
#37,433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dotCMS : SDK Team : Modernization Type : Task
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Use a dotCMS instance as the model provider for the accessibility agent, via @ai-sdk/openai-compatible.

import { createOpenAICompatible } from '@ai-sdk/openai-compatible';

const dotcms = createOpenAICompatible({
  name: 'dotcms',
  baseURL: `${DOTCMS_HOST}/api/inference/v1`,
  apiKey: DOTCMS_API_TOKEN,
});

model: dotcms('claude-sonnet-4-6')

Depends on #37431, which adds the /api/inference/v1 endpoints.

Where the code lands. dotCMS/microservice-accessability. Provider selection is already isolated in src/agents/runtime/model.ts behind an AgentProvider union and a PROVIDER_DEFAULT_MODEL record, so this is a new case plus config validation in src/config.ts. Tracked here because it is gated on #37431.

Constraints to build against, verified against a running instance. Chat, streaming, tool calling, stream_options.include_usage, embeddings and image generation all work.

  • baseURL must end in /api/inference/v1. The package appends /chat/completions, /embeddings and /images/generations; a base URL missing /v1 returns a 404 that reads like a server fault.
  • Vision is unsupported. A plain string and an array of text parts are both accepted; any non-text part returns a 400 naming the part type.
  • frequency_penalty, presence_penalty, seed and user are accepted and ignored. Only temperature, max_tokens, top_p and stop reach a provider, so seed will not give reproducible output.
Acceptance Criteria
  • dotcms added to the AgentProvider union in src/agents/runtime/model.ts, backed by createOpenAICompatible
  • PROVIDER_DEFAULT_MODEL gains a dotCMS default
  • Config validation in src/config.ts for the host and API token, with the base URL either required in full or derived, so a missing /v1 cannot reach a request
  • The API token is sent as Authorization: Bearer and is never logged
  • dotCMS error responses map to AI SDK error types where the package's defaults are not already correct
  • Existing agent tests still green with the new provider case
  • The agent completes a multi-step tool-calling run (src/agents/runtime/model-call.ts, stepCountIs(24)) against a dotCMS instance using only base URL + token
  • Setup documented: base URL with /v1, token as apiKey, unsupported vision, ignored sampling parameters
Priority

Medium — blocked on #37431 landing first.

Additional Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Work in dotCMS/microservice-accessability, starting with src/agents/runtime/model.ts and src/config.ts; review the existing AgentProvider and PROVIDER_DEFAULT_MODEL patterns, then inspect src/agents/runtime/model-call.ts for the stepCountIs(24) run. Validate the provider against a dotCMS instance after #37431 lands, run the existing agent tests, and document the /v1 base URL, token, unsupported vision, and ignored sampling parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.