A "completion" in CodeGPT is the generated response from an AI Agent based on the provided input and context.

In CodeGPT, a "completion" refers to the output produced by an AI Agent in response to a 'message' input. This 'message' is a structured JSON object that includes the role (user or assistant) and the content (the actual text of the message).

  "agent": "CODEGPT_AGENT_ID", 
  "messages": [
			"role": "user",
      "content": "Hello, Agent!"

To obtain a "completion", you send a request to the CodeGPT API including this 'message' and the Agent ID of the AI Agent you want to use. The agent processes your 'message', performs a semantic search on its knowledge base, and generates a response. This response, returned by the API, is the "completion".

The "completion" is a contextually relevant response that considers the content of the 'message' and the information from the agent's knowledge base, providing a more accurate and meaningful interaction.