聊天游戏自由
用于与 ChatGPT API 合作的服务列表
Before working with the API make sure you have the `OPEN AI API KEY` in the env variables
it should be avaliable with process.env.OPEN_AI_API_KEY
aPI 密钥将用来与 openAI API 授权
OPEN_AI_API_KEY
process.env.OPEN_AI_API_KEY
目前提供的服务
我们将会有一份服务清单 用于不同目的
协作服务
可用于提出产品建议和快速答复建议的服务
使用量
提出一些快速的答复 谈话
const { CopilotService } = require('@cobrowser/chatgpt');
const copilotService = new CopilotService();
const conversation = `
Customer: Hello
Agent: Hello
Customer: Need some help
`;
/**
* return a promise that will resolve a string ( a list of suggestions ) or an undefined or an error
*/
copilotService.suggest(conversation);
翻译处
可用于将文本从一种语言翻译到另一种语言
使用量
const { TranslationService } = require('@cobrowser/chatgpt');
const service = new TranslationService();
const translation = await service.translate('Text to Translate');
translate(text: string, toLanguage = 'English', fromLanguage?: string)
By Default if languages didn't specifed the default language to translate to will be English
所有服务都将有其 API 文档( 感谢 Typescript)