Skip to main content

OpenAI

所有与 OpenAI 相关的功能

¥All functionality related to OpenAI

OpenAI 是美国人工智能 (AI) 研究实验室,由非营利组织 OpenAI Incorporated 及其营利性子公司 OpenAI Limited Partnership 组成。OpenAI 开展人工智能研究,旨在推广和开发友好的人工智能。OpenAI 系统运行在基于 Azure 的超级计算平台上,该平台源自 Microsoft

¥OpenAI is American artificial intelligence (AI) research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership. OpenAI conducts AI research with the declared intention of promoting and developing a friendly AI. OpenAI systems run on an Azure-based supercomputing platform from Microsoft.

OpenAI API 由一系列功能和价位各异的模型提供支持。

¥The OpenAI API is powered by a diverse set of models with different capabilities and price points.

ChatGPT 是由 OpenAI 开发的人工智能 (AI) 聊天机器人。

¥ChatGPT is the Artificial Intelligence (AI) chatbot developed by OpenAI.

安装和设置

¥Installation and Setup

  • 获取 OpenAI API 密钥并将其设置为环境变量(OPENAI_API_KEY)。

    ¥Get an OpenAI api key and set it as an environment variable (OPENAI_API_KEY)

聊天模型

¥Chat model

请参阅 使用示例

¥See a usage example.

import { ChatOpenAI } from "@langchain/openai";

LLM

请参阅 使用示例

¥See a usage example.

npm install @langchain/openai @langchain/core
import { OpenAI } from "@langchain/openai";

文本嵌入模型

¥Text Embedding Model

请参阅 使用示例

¥See a usage example

import { OpenAIEmbeddings } from "@langchain/openai";

¥Chain

import { OpenAIModerationChain } from "langchain/chains";