-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add document Q&A chat API server example #83
Conversation
fe5b42d
to
9d36b44
Compare
if workload.Document == "" { | ||
return errors.New("document cannot be empty") | ||
} | ||
if workload.LLMType == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above .
examples/chat_with_document/main.go
Outdated
app.Use(cors.New(cors.ConfigDefault)) | ||
|
||
app.Get("/", HomePageGetHandler) | ||
app.Post("/load", LoadHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as /chat
we use our pre-confiugred apikey and chromadb for loading documents
f382825
to
de7f400
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the comments
examples/chat_with_document/util.go
Outdated
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use start.go
instead of util.go
return c.SendString("OK") | ||
} | ||
|
||
func (w Workload) EmbedDocument(ctx context.Context, documents []schema.Document) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use (w Workload)
, you can move document load
and splt
in this function
30ccdae
to
8494ed1
Compare
Signed-off-by: Lanture1064 <[email protected]>
feat: add document Q&A chat API server example
No description provided.