Skip to content

Latest commit

 

History

History
120 lines (72 loc) · 4.7 KB

README.md

File metadata and controls

120 lines (72 loc) · 4.7 KB

Eval AI !

Todo

  • fix eval-ai running prisma
  • 研究怎么把 trpc 静态编译那玩意给 generic 了

Architecture

要点

  • 后台静默流是可以不做的(或者高级版?),因为需要维护一个进程池,没有必要,用户打断我们即中止
  • 消息的回溯是可以不做的(或者高级版?),因为要考虑数据库同步问题,以及组装上下文到底是在客户端还是服务端
  • 【乐观刷新】前期为了保证开发速度与质量,可以暂时先不用
  • 【状态管理】jotai vs zustand vs vs valtio
  • 【trpc状态同步】在列表页上,我们还是用了invalidate机制,避免了手写各种convs的更新与对齐,然后本地的convs始终对齐trcp的列表数据即可
  • 【llm-manager同步】(2024-03-09)在经历了痛苦的同步控制,最后不得不用上redis并陷入序列化的困境后,我最终决定放弃一切幻想all in pusher

Conversation

  • queryConv --> queryRequest --> queryResponse
  • queryRequest = queryContext + n * queryConfig
  • queryConfig -- queryResponse

api ref

Tech

[Init] install

# ref: https://github.com/yarnpkg/berry/issues/3521#issuecomment-1907517793
# 阿里的库会有证书过期问题
yarn config set "strict-ssl" false -g

[zod-prisma-types]

[NextJS] server action 在 dev 里可以放在 route 里,但 build 时会失败

[DevOps] 控制台颜色

首先,我们读了 trpc 的 loggerLink 源码,它是用 ansi/css 两种写法分别决定 node/browser 颜色的

我尝试了 colors, chalk(基于gpt),都只能 node 用

最后在 chalk 的一个 issue 里顺着别人的路用了 ansi-colors

[Core] Websocket Integration

[Polyfill] tsx 导入 Credentials

import CredentialsModule from "next-auth/providers/credentials"

// sb tsx 需要用 default
const Credentials = (
  "default" in CredentialsModule ? CredentialsModule.default : CredentialsModule
) as typeof CredentialsModule

[UI] text with gradient color

[Backend] nginx

[Core] wechat-auth

虽然微信登录起步是访问一个 open-wechat 的网址,但不能直接点击跳转,而是在 provider 的 authorizationUrl 里配置好后,在程序里使用 signIn 去操作,否则会报 State cookie was missing

[Core] zustand

BUGFIX

sonner 版本要求

这个不行: "sonner": "^1.4.0",,参考:emilkowalski/sonner#353

jotai 不可以 在 set 里 set writable variable, 那是用于 useAtom 的,见:

img.png

ref:

- [x] import sum from "lodash/sum"

问题: 这个会导致 yarn updatespawn 里编译时失败。

解决:将 @types/lodash 加入 prod 依赖即可。

原因分析:还没有完全明白,就是在全新的shell里编译好像会导致node_modules不符合预期,这个可以做一个新的todo。

How do I deploy this?

Follow our deployment guides for Vercel, Netlify and Docker for more information.