Skip to content

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 4, 2025

Description

refactor: shared function for constructing llm api


Summary by cubic

Centralized LLM API construction with a new createLlmApi(model, auth) helper and updated ModelService to use it. This removes duplicated logic, standardizes continue-proxy handling (org scope and on‑prem proxy), and simplifies tests.

  • Refactors

    • Added createLlmApi in config.ts; getLlmApi now delegates to it.
    • ModelService now calls createLlmApi for init and model switching.
    • Updated mocks and tests to use createLlmApi.
    • Minor doc and formatting cleanups.
  • Dependencies

    • Added prettier-plugin-tailwindcss (dev).

@sestinj sestinj requested a review from a team as a code owner September 4, 2025 00:34
@sestinj sestinj requested review from tomasz-stefaniak and removed request for a team September 4, 2025 00:34
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 4, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

orgScopeId: organizationId,
proxyUrl: undefined, // TODO
proxyUrl: (model as any).onPremProxyUrl ?? undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a stricter type here?

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 10, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants