getCodeAskWithHttpInfo method

Future<Response> getCodeAskWithHttpInfo({
  1. String? q,
  2. String? repo,
})

Answers a question about the caller org's code with a CITED answer: retrieval packs grounding context, then the synthesizer writes the answer over exactly those spans, which come back alongside it.

Answers a question about the caller org's code with a CITED answer: retrieval packs grounding context, then the synthesizer writes the answer over exactly those spans, which come back alongside it. It never answers without grounding — with no matched code the answer is empty and says so, and with no synthesizer available the citations still come back with "degraded": true so the caller can reason over the spans itself.

Note: This method returns the HTTP Response.

Parameters:

  • String q: Q is the question to answer. Required, max 4000 bytes.

  • String repo: Repo narrows retrieval to one repository. Empty searches every repo the org has indexed.

Implementation

Future<Response> getCodeAskWithHttpInfo({ String? q, String? repo, }) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/code/ask';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (q != null) {
    queryParams.addAll(_queryParams('', 'q', q));
  }
  if (repo != null) {
    queryParams.addAll(_queryParams('', 'repo', repo));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}