Skip to content
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

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

Lanture1064
Copy link
Collaborator

No description provided.

@Lanture1064 Lanture1064 marked this pull request as ready for review September 13, 2023 09:20
if workload.Document == "" {
return errors.New("document cannot be empty")
}
if workload.LLMType == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above .

app.Use(cors.New(cors.ConfigDefault))

app.Get("/", HomePageGetHandler)
app.Post("/load", LoadHandler)
Copy link
Collaborator

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

Copy link
Collaborator

@bjwswang bjwswang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the comments


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.
Copy link
Collaborator

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 {
Copy link
Collaborator

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

@bjwswang bjwswang merged commit c94a056 into kubeagi:main Sep 15, 2023
4 checks passed
nkwangleiGIT pushed a commit to nkwangleiGIT/arcadia that referenced this pull request Dec 1, 2023
feat: add document Q&A chat API server example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants