From 48b080d15b3014f4d52cb6b83581847b48b6da40 Mon Sep 17 00:00:00 2001 From: YunYouJun Date: Sun, 4 Feb 2024 22:29:55 +0800 Subject: [PATCH] feat: add get data from server api --- .env.example | 1 + README.md | 4 +++ components/AiPrompt.vue | 26 ++++++++++++-- components/SpringFestivalCouplets.vue | 42 +++++++++++++++++----- composables/app.ts | 27 +++++++++++++- nuxt.config.ts | 2 ++ package.json | 2 ++ packages/ai/src/api.ts | 23 +++++++----- packages/ai/src/index.ts | 1 + pages/index.vue | 5 +-- pnpm-lock.yaml | 51 +++++++++++++++++++++++++++ server/api/generate.ts | 13 +++++++ uno.config.ts | 2 +- 13 files changed, 175 insertions(+), 24 deletions(-) create mode 100644 .env.example create mode 100644 server/api/generate.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e570b8b --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +OPENAI_API_KEY= diff --git a/README.md b/README.md index f22158e..a0bcc55 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # AI Couplets - AI 对联/春联 +## Todo + +- [ ] 分享春联 + ## Dev ```bash diff --git a/components/AiPrompt.vue b/components/AiPrompt.vue index a1da9b0..66625f2 100644 --- a/components/AiPrompt.vue +++ b/components/AiPrompt.vue @@ -1,5 +1,19 @@ diff --git a/components/SpringFestivalCouplets.vue b/components/SpringFestivalCouplets.vue index 450408a..0853852 100644 --- a/components/SpringFestivalCouplets.vue +++ b/components/SpringFestivalCouplets.vue @@ -1,7 +1,15 @@