Skip to content

Create/update AI Configuration#4147

Open
nelsonkopliku wants to merge 6 commits intoexpose-ai-configuration-in-profilefrom
ai-onboarding-api
Open

Create/update AI Configuration#4147
nelsonkopliku wants to merge 6 commits intoexpose-ai-configuration-in-profilefrom
ai-onboarding-api

Conversation

@nelsonkopliku
Copy link
Copy Markdown
Member

@nelsonkopliku nelsonkopliku commented Apr 3, 2026

Description

This PR adds the endpoints to create and update own AI configuration.

More than half of the changes are tests.

Comes after #4140 and #4143

Depends on #4143

How was this tested?

Automated and IRL tests.

@nelsonkopliku nelsonkopliku self-assigned this Apr 3, 2026
@nelsonkopliku nelsonkopliku added the enhancement New feature or request label Apr 3, 2026
@nelsonkopliku nelsonkopliku changed the title Ai onboarding api Create/update AI Configuration Apr 3, 2026
@nelsonkopliku nelsonkopliku force-pushed the expose-ai-configuration-in-profile branch from 0b8c6b2 to 41dc558 Compare April 7, 2026 14:47
Copy link
Copy Markdown
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Looks good!
I left some comments as I'm unsure about some of the business logic we pretend to implement.
I recommend letting somebody else who is more aware of things to double-check hehe

type: :object,
additionalProperties: false,
properties: %{
model: %Schema{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question:
Don't we need the AI provider field here?
The same for the update.
Or do you extract the provide in the backend somehow?
Is it possible to have the same model name for multiple providers at any given time in the future?

Copy link
Copy Markdown
Member Author

@nelsonkopliku nelsonkopliku Apr 8, 2026

Choose a reason for hiding this comment

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

The idea is to extract the provider based on the model. See here

Is it possible to have the same model name for multiple providers at any given time in the future?

Good question. Technically it might be possible, although it's not in the immediate scope.

Anyway, in the current scheme of things where the provider/model map is defined as follows

config :trento, :ai,
  enabled: true,
  providers: [
    googleai: [
      models: [
        "gemini-2.5-pro",
        "gemini-2.5-flash",
        "gemini-2.5-flash-lite",
        "gemini-3.1-flash-preview",
        "gemini-3.1-flash-lite-preview",
        "gemini-3.1-pro-preview"
      ]
    ],
    openai: [
      models: [
        "o3-mini",
        "o3",
        "gpt-4.1",
        "gpt-4",
        "gpt-5-mini",
        "gpt-5.4"
      ]
    ],
    anthropic: [
      models: [
        "claude-opus-4-6",
        "claude-sonnet-4-6",
        "claude-haiku-4-5"
      ]
    ]
  ]

we could have the same model in many providers by for instace prepending the provider to the model name openai/modelname and googleai/modelname

This could be either at config level or extracted when provided as a request parameter.

I think we can extend when the need arises.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, I made provider to be explicitly set upon creation and update in this commit 700aa78.

It was a bit more tedious than I hoped and made the PR changes rise by more than 50% 🙈 (it is fair to say that it is mainly tests, tho)

Now, in total honesty I found the previous version simpler, and it was easily extendable as well to support the same model over many providers scenario by changing the pattern of the model name (the openai/modelname and googleai/modelname option).

However, in any case it is very likely that things around this topic will change because we aim to be able to get the model list from providers' APIs, but we're not sure it will be in the very first version.

If you ask me, I would revert the last commit 700aa78 and go ahead from there, but I want to hear your opinion as well.

@nelsonkopliku nelsonkopliku force-pushed the expose-ai-configuration-in-profile branch from d795031 to b06dc2b Compare April 8, 2026 08:14
Copy link
Copy Markdown
Contributor

@gagandeepb gagandeepb left a comment

Choose a reason for hiding this comment

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

Thanks for this.

@nelsonkopliku nelsonkopliku force-pushed the expose-ai-configuration-in-profile branch from b06dc2b to 8c061b2 Compare April 8, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

4 participants