Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
在 LangChain 中通过 OpenAI 兼容格式使用 AGICTO API
npm install @langchain/openai @langchain/core
import { ChatOpenAI } from "@langchain/openai"; const model = new ChatOpenAI({ apiKey: process.env.AGICTO_API_KEY, model: process.env.AGICTO_CHAT_MODEL, configuration: { baseURL: "https://api.agicto.cn/v1/" } }); const result = await model.invoke("请用一句话介绍 AGICTO API。"); console.log(result.content);
pip install langchain-openai
import os from langchain_openai import ChatOpenAI model = ChatOpenAI( api_key=os.environ["AGICTO_API_KEY"], base_url="https://api.agicto.cn/v1/", model=os.environ["AGICTO_CHAT_MODEL"], ) result = model.invoke("请用一句话介绍 AGICTO API。") print(result.content)
https://api.agicto.cn/v1/