Skip to content

Commit

Permalink
feat: add open ai api
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Feb 4, 2024
1 parent e139062 commit d39b04c
Show file tree
Hide file tree
Showing 13 changed files with 1,251 additions and 69 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@
"json",
"jsonc",
"yaml"
],
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"deepseek"
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"nuxt": "^3.9.3",
"nuxt-module-eslint-config": "^0.0.2",
"pinia": "^2.1.7",
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
}
Expand Down
1 change: 1 addition & 0 deletions packages/ai/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=
13 changes: 13 additions & 0 deletions packages/ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AI

Based on [openai-node](https://github.com/openai/openai-node).

- API from [DeepSeek](https://platform.deepseek.com/).

## FAQ

### Why not use [langchain.js](https://js.langchain.com/)?

- It's too complex, and the documentation isn't friendly. I tried running a demo on the official website, but the api indicated deprecate.
- It's hard for me to get raw data on api responses.
- The openai sdk download is higher.
11 changes: 11 additions & 0 deletions packages/ai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"private": true,
"engines": {
"node": ">=18"
},
"dependencies": {
"consola": "^3.2.3",
"dotenv": "^16.4.1",
"openai": "^4.26.0"
}
}
Loading

0 comments on commit d39b04c

Please sign in to comment.