getModelUpstreamId (config/providerModels.ts)

OpenCursor · src/agent/oauth/protocols/config/providerModels.ts · typescript · MIT
ai

Utility to retrieve provider model IDs and upstream mapping for AI protocols.

// Source: https://github.com/PawanOsman/OpenCursor | License: MIT | Copyright 2026 Pawan Osman
// Provided via justclaw.it.com; keep this notice with the code.
/*
 * Copyright (c) 2026 Pawan Osman <https://github.com/PawanOsman>
 *
 * This file is part of OpenCursor — AI coding agent chat inside VS Code.
 * https://github.com/PawanOsman/OpenCursor
 *
 * Licensed under the MIT License. See LICENSE file in the project root.
 */

import type { ProtocolValue } from "../wireTypes.js";
import { PROVIDER_MODELS } from '../providers/index.js';
export { PROVIDER_MODELS };
export const getProviderModels = (kind: ProtocolValue) => PROVIDER_MODELS[kind] || [];
export function getModelUpstreamId(kind: ProtocolValue, model: string) { return getProviderModels(kind).find((entry: ProtocolValue) => entry.i

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key