MCPcopy
hub / github.com/ericc-ch/copilot-api / getModels

Function getModels

src/services/copilot/get-models.ts:5–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { state } from "~/lib/state"
4
5export const getModels = async () => {
6 const response = await fetch(`${copilotBaseUrl(state)}/models`, {
7 headers: copilotHeaders(state),
8 })
9
10 if (!response.ok) throw new HTTPError("Failed to get models", response)
11
12 return (await response.json()) as ModelsResponse
13}
14
15export interface ModelsResponse {
16 data: Array<Model>

Callers 1

cacheModelsFunction · 0.90

Calls 2

copilotBaseUrlFunction · 0.90
copilotHeadersFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…