
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@celljs/ai-anthropic
Advanced tools
AI Anthropic 模块是一个用于与 Anthropic API 交互的库,提供了生成聊天响应和嵌入向量的功能。通过简单易用的 API 接口,支持消息的创建、请求的发送和响应的处理。是 @celljs/ai-core 模块中所有模型服务接口抽象的一种实现。
使用 npm 安装 AI Anthropic 模块:
npm install @celljs/ai-anthropic
或者使用 yarn:
yarn add @celljs/ai-anthropic
以下是一个简单的示例,展示如何使用 AI Anthropic 模块生成聊天响应:
import { AssistantMessage, PromptTemplate } from '@celljs/ai-core';
import { OllamChatModel, OllamModel, } from '@celljs/ai-anthropic';
import { Component Autowired } from '@celljs/core';
@Component()
export class AnthropicDemo {
@Autowired(AnthropicChatModel)
private anthropicChatModel: AnthropicChatModel;
@Autowired(PromptTemplate)
private promptTemplate: PromptTemplate;
/**
* Chat with Anthropic
*/
async chat() {
const prompt = await this.promptTemplate.create(
'Hello {name}',
{
chatOptions: { model: AnthropicModel.CLAUDE_3_5_SONNET },
variables: { name: 'Anthropic' }
}
);
const response = await this.anthropicChatModel.call(prompt);
console.log(response.result.output);
}
/**
* Stream chat response
*/
async stream() {
const prompt = await this.promptTemplate.create(
'Hello {name}',
{
chatOptions: { model: AnthropicModel.CLAUDE_3_5_SONNET },
variables: { name: 'Anthropic' }
}
);
const response$ = await this.anthropicChatModel.stream(prompt);
response$.subscribe({
next: response => console.log(response.result.output),
complete: () => console.log('Chat completed!')
});
}
}
本项目采用 MIT 许可证。
FAQs
Authropic models support
The npm package @celljs/ai-anthropic receives a total of 4 weekly downloads. As such, @celljs/ai-anthropic popularity was classified as not popular.
We found that @celljs/ai-anthropic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.