Implement Anthropic experimentation API
What does this MR do and why?
This implements the /api/v4/ai/experimentation/anthropic/complete
endpoint that team members can use to interact with Anthropic API.
Just like other experimentation API, workhorse will handle the actual request.
This is behind the following feature flags:
anthropic_experimentation
ai_experimentation_api
How to set up and validate locally
- Set your API key via rails console:
Gitlab::CurrentSettings.update!(anthropic_api_key: <insert API key>)
. If you don't have one yet, create one in https://console.anthropic.com/account/keys if you have access. - Enable
anthropic_experimentation
andai_experimentation_api
feature flags. - Make a POST request to
http://localhost:3000/api/v4/ai/experimentation/anthropic/complete
with the following body:
{
'prompt':'Hi',
'model':'claude-v1.3',
'max_tokens_to_sample':100
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #409816