Skip to main content
Glama
PSPDFKit

Nutrient Document Engine MCP Server

by PSPDFKit
utils.ts782 B
import { initChatModel } from "langchain/chat_models/universal"; /** * Load a chat model from a fully specified name. * @param fullySpecifiedName - String in the format 'provider/model' or 'provider/account/provider/model'. * @returns A Promise that resolves to a BaseChatModel instance. */ export async function loadChatModel( fullySpecifiedName: string ): Promise<ReturnType<typeof initChatModel>> { const index = fullySpecifiedName.indexOf("/"); if (index === -1) { // If there's no "/", assume it's just the model return await initChatModel(fullySpecifiedName); } else { const provider = fullySpecifiedName.slice(0, index); const model = fullySpecifiedName.slice(index + 1); return await initChatModel(model, { modelProvider: provider }); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PSPDFKit/nutrient-document-engine-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server