|
| 1 | +openapi: 3.0.0 |
| 2 | +info: |
| 3 | + title: Sourcegraph |
| 4 | + version: Latest |
| 5 | +tags: [] |
| 6 | +paths: |
| 7 | + /.api/cody/context: |
| 8 | + post: |
| 9 | + operationId: CodyService_context |
| 10 | + summary: Find relevant source locations given a natural language query |
| 11 | + description: |- |
| 12 | + Returns a list of source code locations (aka. "context") that are relevant |
| 13 | + to the given natural language query and list of repos. |
| 14 | + parameters: [] |
| 15 | + responses: |
| 16 | + '200': |
| 17 | + description: The request has succeeded. |
| 18 | + content: |
| 19 | + application/json: |
| 20 | + schema: |
| 21 | + $ref: '#/components/schemas/CodyContextResponse' |
| 22 | + requestBody: |
| 23 | + required: true |
| 24 | + content: |
| 25 | + application/json: |
| 26 | + schema: |
| 27 | + $ref: '#/components/schemas/CodyContextRequest' |
| 28 | + /.api/llm/models: |
| 29 | + get: |
| 30 | + operationId: OAIModels_list |
| 31 | + description: Lists the currently available models, and provides basic information about each one such as the owner and availability. |
| 32 | + parameters: [] |
| 33 | + responses: |
| 34 | + '200': |
| 35 | + description: The request has succeeded. |
| 36 | + content: |
| 37 | + application/json: |
| 38 | + schema: |
| 39 | + $ref: '#/components/schemas/OAIListModelsResponse' |
| 40 | + default: |
| 41 | + description: An unexpected error response. |
| 42 | + content: |
| 43 | + application/json: |
| 44 | + schema: |
| 45 | + $ref: '#/components/schemas/Error' |
| 46 | + /.api/llm/models/{modelId}: |
| 47 | + get: |
| 48 | + operationId: OAIModels_retrieveModel |
| 49 | + description: Retrieves a model instance, providing basic information about the model such as the owner and permissioning. |
| 50 | + parameters: |
| 51 | + - name: modelId |
| 52 | + in: path |
| 53 | + required: true |
| 54 | + schema: |
| 55 | + type: string |
| 56 | + responses: |
| 57 | + '200': |
| 58 | + description: The request has succeeded. |
| 59 | + content: |
| 60 | + application/json: |
| 61 | + schema: |
| 62 | + $ref: '#/components/schemas/OAIModel' |
| 63 | + default: |
| 64 | + description: An unexpected error response. |
| 65 | + content: |
| 66 | + application/json: |
| 67 | + schema: |
| 68 | + $ref: '#/components/schemas/Error' |
| 69 | +components: |
| 70 | + schemas: |
| 71 | + BlobInfo: |
| 72 | + type: object |
| 73 | + required: |
| 74 | + - path |
| 75 | + - repository |
| 76 | + - commit |
| 77 | + - url |
| 78 | + properties: |
| 79 | + path: |
| 80 | + type: string |
| 81 | + repository: |
| 82 | + $ref: '#/components/schemas/RepositoryInfo' |
| 83 | + commit: |
| 84 | + $ref: '#/components/schemas/CommitInfo' |
| 85 | + url: |
| 86 | + type: string |
| 87 | + CodyContextRequest: |
| 88 | + type: object |
| 89 | + required: |
| 90 | + - query |
| 91 | + properties: |
| 92 | + repos: |
| 93 | + type: array |
| 94 | + items: |
| 95 | + $ref: '#/components/schemas/RepoSpec' |
| 96 | + description: The list of repos to search through. |
| 97 | + query: |
| 98 | + type: string |
| 99 | + description: The natural language query to find relevant context from the provided list of repos. |
| 100 | + codeResultsCount: |
| 101 | + type: integer |
| 102 | + format: int32 |
| 103 | + minimum: 0 |
| 104 | + maximum: 100 |
| 105 | + description: 'The number of results to return from source code (example: Python or TypeScript).' |
| 106 | + default: 15 |
| 107 | + textResultsCount: |
| 108 | + type: integer |
| 109 | + format: int32 |
| 110 | + minimum: 0 |
| 111 | + maximum: 100 |
| 112 | + description: The number of results to return from text sources like Markdown. |
| 113 | + default: 5 |
| 114 | + CodyContextResponse: |
| 115 | + type: object |
| 116 | + required: |
| 117 | + - results |
| 118 | + properties: |
| 119 | + results: |
| 120 | + type: array |
| 121 | + items: |
| 122 | + $ref: '#/components/schemas/FileChunkContext' |
| 123 | + CommitInfo: |
| 124 | + type: object |
| 125 | + required: |
| 126 | + - oid |
| 127 | + properties: |
| 128 | + oid: |
| 129 | + type: string |
| 130 | + Error: |
| 131 | + type: object |
| 132 | + required: |
| 133 | + - type |
| 134 | + - message |
| 135 | + properties: |
| 136 | + type: |
| 137 | + type: string |
| 138 | + message: |
| 139 | + type: string |
| 140 | + FileChunkContext: |
| 141 | + type: object |
| 142 | + required: |
| 143 | + - blob |
| 144 | + - startLine |
| 145 | + - endLine |
| 146 | + - chunkContent |
| 147 | + properties: |
| 148 | + blob: |
| 149 | + $ref: '#/components/schemas/BlobInfo' |
| 150 | + startLine: |
| 151 | + type: integer |
| 152 | + format: int32 |
| 153 | + endLine: |
| 154 | + type: integer |
| 155 | + format: int32 |
| 156 | + chunkContent: |
| 157 | + type: string |
| 158 | + OAIListModelsResponse: |
| 159 | + type: object |
| 160 | + required: |
| 161 | + - object |
| 162 | + - data |
| 163 | + properties: |
| 164 | + object: |
| 165 | + type: string |
| 166 | + enum: |
| 167 | + - list |
| 168 | + data: |
| 169 | + type: array |
| 170 | + items: |
| 171 | + $ref: '#/components/schemas/OAIModel' |
| 172 | + OAIModel: |
| 173 | + type: object |
| 174 | + required: |
| 175 | + - id |
| 176 | + - object |
| 177 | + - created |
| 178 | + - owned_by |
| 179 | + properties: |
| 180 | + id: |
| 181 | + type: string |
| 182 | + description: The model identifier, which can be referenced in the API endpoints. |
| 183 | + object: |
| 184 | + type: string |
| 185 | + enum: |
| 186 | + - model |
| 187 | + description: The object type, which is always "model". |
| 188 | + created: |
| 189 | + type: integer |
| 190 | + format: int64 |
| 191 | + description: The Unix timestamp (in seconds) when the model was created. |
| 192 | + owned_by: |
| 193 | + type: string |
| 194 | + description: The organization that owns the model. |
| 195 | + description: Describes an OpenAI model offering that can be used with the API. |
| 196 | + RepoSpec: |
| 197 | + type: object |
| 198 | + properties: |
| 199 | + name: |
| 200 | + type: string |
| 201 | + description: The name of the repository. |
| 202 | + id: |
| 203 | + type: string |
| 204 | + description: The ID of the repository. |
| 205 | + description: |- |
| 206 | + RepoSpec matches a repository either by name or ID. |
| 207 | +
|
| 208 | + Exactly one of the properties must be defined. For example, the message |
| 209 | + `{id:"id", name:"name"}` is invalid because it declares both id and name. |
| 210 | + RepositoryInfo: |
| 211 | + type: object |
| 212 | + required: |
| 213 | + - id |
| 214 | + - name |
| 215 | + properties: |
| 216 | + id: |
| 217 | + type: string |
| 218 | + name: |
| 219 | + type: string |
| 220 | + Versions: |
| 221 | + type: string |
| 222 | + enum: |
| 223 | + - V5_7 |
| 224 | + - V5_8 |
| 225 | + - Latest |
0 commit comments