Generate a Chat response
POST
/api/v4/chat/completions
Generates a response for a GitLab Duo Chat question.
Authorizations
Section titled “ Authorizations ”Request Body required
Section titled “ Request Body required ” Media type application/json
object
content
required
Prompt from user
string
resource_type
Resource type
string
referer_url
Referer URL
string
client_subscription_id
Client Subscription ID
string
with_clean_history
Indicates if we need to reset the history before and after the request
boolean
project_id
Project ID. Required if resource_type is a commit.
integer
current_file
Object that contains information about the current file
object
file_name
The name of the current file
string
content_above_cursor
The content above cursor
string
content_below_cursor
The content below cursor
string
selected_text
The content currently selected by the user
string
additional_context
List of additional context to be passed for the chat
Array<object>
object
category
required
Category of the additional context.
string
id
required
ID of the additional context.
string
content
required
Content of the additional context.
string
metadata
Metadata of the additional context.
object
Responses
Section titled “ Responses ”Created
Bad Request