Create an Google AI Studio inference endpoint Generally available; Added in 8.15.0
Path parameters
-
The type of the inference task that the model will perform.
Values are
completion
ortext_embedding
. -
The unique identifier of the inference endpoint.
PUT /_inference/{task_type}/{googleaistudio_inference_id}
Console
PUT _inference/completion/google_ai_studio_completion { "service": "googleaistudio", "service_settings": { "api_key": "api-key", "model_id": "model-id" } }
resp = client.inference.put( task_type="completion", inference_id="google_ai_studio_completion", inference_config={ "service": "googleaistudio", "service_settings": { "api_key": "api-key", "model_id": "model-id" } }, )
const response = await client.inference.put({ task_type: "completion", inference_id: "google_ai_studio_completion", inference_config: { service: "googleaistudio", service_settings: { api_key: "api-key", model_id: "model-id", }, }, });
response = client.inference.put( task_type: "completion", inference_id: "google_ai_studio_completion", body: { "service": "googleaistudio", "service_settings": { "api_key": "api-key", "model_id": "model-id" } } )
$resp = $client->inference()->put([ "task_type" => "completion", "inference_id" => "google_ai_studio_completion", "body" => [ "service" => "googleaistudio", "service_settings" => [ "api_key" => "api-key", "model_id" => "model-id", ], ], ]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"service":"googleaistudio","service_settings":{"api_key":"api-key","model_id":"model-id"}}' "$ELASTICSEARCH_URL/_inference/completion/google_ai_studio_completion"
Request example
Run `PUT _inference/completion/google_ai_studio_completion` to create an inference endpoint to perform a `completion` task type.
{ "service": "googleaistudio", "service_settings": { "api_key": "api-key", "model_id": "model-id" } }