AFFiNE/packages/backend/server
pengx17 7c5a259e84
fix(core): update prompts (#6738)
Update prompts:

When sending a message to openai, we actually send two messages.
There are two issues here:

1. the role in the first message shall be user or system
2. the content in the first message is not being interpolated at all.

```
[
  {
    role: "assistant",
    createdAt: "2024-04-27T06:30:34.820Z",
    params: {
      language: "French",
    },
    content: "You are a translation expert, please translate the following content into French, and only perform the translation action, keeping the translated content in the same format as the original content:\n\n          \"\"\"\"\n\n          \n\n          \"\"\"\"",
  },
  {
    role: "user",
    content: "Basic things you should know:",
    attachments: undefined,
    params: {
      language: "French",
    },
    createdAt: "2024-04-29T09:42:11.466Z",
  },
]
```

In this PR I removed `content` from prompts and let open ai use the second message (user) as the input.
2024-04-29 11:02:16 +00:00
..
migrations feat: text to image impl (#6437) 2024-04-10 12:13:39 +00:00
scripts ci: set private key from env (#6239) 2024-03-21 10:09:26 +00:00
src fix(core): update prompts (#6738) 2024-04-29 11:02:16 +00:00
tests test: copilot unit & e2e test (#6649) 2024-04-26 09:43:35 +00:00
.env.example fix: improve self-host convenience (#5582) 2024-01-15 09:24:53 +00:00
.gitignore refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00
LICENSE refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00
package.json chore(server): use native file-type implementation (#6686) 2024-04-29 04:46:26 +00:00
README.md refactor(server): rename @affine/storage to @affine/server-native (#6682) 2024-04-29 02:14:20 +00:00
schema.prisma feat: text to image impl (#6437) 2024-04-10 12:13:39 +00:00
tsconfig.json refactor(server): rename @affine/storage to @affine/server-native (#6682) 2024-04-29 02:14:20 +00:00
tsconfig.node.json refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00

Server

Get started

Install dependencies

yarn

Build Native binding

yarn workspace @affine/server-native build

Run server

yarn dev

now you can access the server GraphQL endpoint at http://localhost:3000/graphql