https://github.com/chatlunalab/adapters
ChatLuna 模型适配器项目
https://github.com/chatlunalab/adapters
Last synced: 5 months ago
JSON representation
ChatLuna 模型适配器项目
- Host: GitHub
- URL: https://github.com/chatlunalab/adapters
- Owner: ChatLunaLab
- License: mit
- Created: 2024-07-19T21:09:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-15T13:50:00.000Z (5 months ago)
- Last Synced: 2025-01-15T14:28:45.788Z (5 months ago)
- Language: TypeScript
- Size: 4.69 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# ChatLuna Adapters
ChatLuna 模型适配器项目。
## 项目结构
- [@chatluna/adapter-openai](./packages/openai/README.MD)
为 ChatLuna 提供 OpenAI 支持的适配器。
## 用法
### Requester
```ts
const requester = new OpenAIRequester({
apiKey: '',
apiEndpoint: 'https://api.openai.com/v1'
})const messages = [new HumanMessage('What is the capital of France?')]
const generation = await requester.completion({
input: messages,
model: 'gpt-3.5-turbo',
maxTokens: 100
})console.log(generation.message.content)
```### With Client (LangChain Model)
### With Full Cordis Context (ChatLuna Platform Service, Requester Service)
## 致谢
感谢 [LangChain](https://github.com/langchain-ai/langchainjs) 项目。本项目基于其进行二次封装。
最后感谢所有 ChatLuna 的贡献者和用户,没有你们的支持,ChatLuna 就不会继续向前发展。
## 许可证
使用 [MIT](./LICENSE) 许可证发布。