RaycastAI
注意: 这是一个社区构建的集成,未获得 Raycast 的官方支持。
您可以在 Raycast 环境 中使用 LangChain 的 RaycastAI 类,以使用 Langchain 的功能增强您的 Raycast 扩展。
RaycastAI 类仅在 Raycast 环境中可用,并且截至 2023 年 8 月仅对 Raycast Pro 用户可用。您可以在此处查看如何为 Raycast 创建扩展。
每个 Raycast Pro 用户的速率限制约为每分钟 10 个请求。如果您超出此限制,您将收到错误。您可以通过将
rateLimitPerMinute
传递给RaycastAI
构造函数来设置您期望的 rpm 限制,如示例所示,因为此速率限制将来可能会更改。
提示
有关安装集成包的一般说明,请参阅此部分。
- npm
- Yarn
- pnpm
npm install @langchain/community @langchain/core
yarn add @langchain/community @langchain/core
pnpm add @langchain/community @langchain/core
import { RaycastAI } from "@langchain/community/llms/raycast";
import { Tool } from "@langchain/core/tools";
const model = new RaycastAI({
rateLimitPerMinute: 10, // It is 10 by default so you can omit this line
model: "<model_name>",
creativity: 0, // `creativity` is a term used by Raycast which is equivalent to `temperature` in some other LLMs
});