MCPcopy Create free account
hub / github.com/cursor/cookbook / listModels

Method listModels

sdk/coding-agent-cli/src/agent.ts:108–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 }
107
108 async listModels(): Promise<ModelChoice[]> {
109 const models = await Cursor.models.list({ apiKey: this.apiKey })
110 const choices = disambiguateGlobalDuplicateLabels(
111 dedupeModelChoices(models.flatMap(modelToChoices))
112 )
113
114 return choices.length > 0
115 ? choices
116 : [{ label: this.modelSelection.id, value: this.modelSelection }]
117 }
118
119 async reset() {
120 await this.replaceAgent()

Callers 1

openModelPickerFunction · 0.80

Calls 2

dedupeModelChoicesFunction · 0.85

Tested by

no test coverage detected