Adding candidateCount to parameters for vertex_text code models
What does this merge request do and why?
Adds candidateCount to the code completion API so that clients can consume it to generate code suggestions
Adding candidateCount to parameters for vertex_text code models
Adds candidateCount to parameters for vertex code models to open up ability to cycle through code suggestions.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Check out this MR branch
- Run ai_gateway using the following instructions
- run the following command in the /docs or in your terminal
curl -X 'POST' \
'http://localhost:5052/v2/code/completions' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_path": "string",
"project_id": 0,
"current_file": {
"file_name": "main.py",
"language_identifier": "python",
"content_above_cursor": "print(",
"content_below_cursor": ""
},
"model_provider": "vertex-ai",
"model_endpoint": "https://us-central1-aiplatform.googleapis.com/v1/projects/ai-enablement-dev-69497ba7/locations/us-central1/publishers/google/models/code-gecko@002:predict",
"model_name": "code-gecko@002",
"telemetry": [],
"stream": false,
"options_count": 2,
"prompt_version": 1
}’
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed.
Closes #474 (closed)
Edited by Jeff Park