postCodeContextWithHttpInfo method

Future<Response> postCodeContextWithHttpInfo(
  1. ContextIn contextIn
)

Packs the most relevant code for a query into a token budget — THE primitive for a coding agent that has to decide what to put in a prompt.

Packs the most relevant code for a query into a token budget — THE primitive for a coding agent that has to decide what to put in a prompt. It retrieves seed spans, expands each with the definitions it calls and its key callers, then greedily fills the budget, so the answer is a coherent slice of the codebase rather than a list of disconnected matches. The top match is always included, truncated if it alone overflows, so a matched query never comes back empty. A retrieval outage answers 200 with an empty bundle rather than a 5xx.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> postCodeContextWithHttpInfo(ContextIn contextIn,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/code/context';

  // ignore: prefer_final_locals
  Object? postBody = contextIn;

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

  const contentTypes = <String>['application/json'];


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