mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: implement memos chat backend function (#1934)
* feat: implment backend function * eslint * eslint * eslint
This commit is contained in:
@ -64,6 +64,11 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
}))
|
||||
|
||||
e.Use(middleware.TimeoutWithConfig(middleware.TimeoutConfig{
|
||||
Skipper: func(c echo.Context) bool {
|
||||
// this is a hack to skip timeout for openai chat streaming
|
||||
// because streaming require to flush response. But the timeout middleware will break it.
|
||||
return c.Request().URL.Path == "/api/openai/chat-streaming"
|
||||
},
|
||||
ErrorMessage: "Request timeout",
|
||||
Timeout: 30 * time.Second,
|
||||
}))
|
||||
|
Reference in New Issue
Block a user