-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update doc API #48
base: main
Are you sure you want to change the base?
Update doc API #48
Conversation
Fixes #8. |
Yes. PUT is fine you can just use the Postman or curl to test it. PUT http://localhost:8880/api/v1/docs/{pk} If you don't want to bother with the token, just comment out the |
I am not sure how to test embeddings: Should I write a specialized testing code that check embeddings to be created/deleted as needed? Or is there an easier variant? |
@vporton do you need to test embedding? You just need to be able to search for the new content through the /docs/search endpoint. That is the real test |
I fixed some, but not all, bugs. Please help: The browser outputs
I don't understand how this can happen: The string
It is a post request. From where can a GET request appear? Please help me to understand which piece of the source produces this GET. @apssouza22 |
@apssouza22 Note that this query is triggered by the prompt:
|
We don't have a doc for the doc search. Probably the engine is guessing that search docs uses get. So the get could be generated by the chatGPT. It would be easier just use Postman. Another option is just prompt in the UI "your new text" and then look at the network tab of the browser. The first request is to retrieve the doc based on the input. Just check if it is finding your edited doc |
There is basic issues.
To test. call http://127.0.0.1:8880/api/v1/admin/applications/chat/docs get the PK for the doc you want to edit calll http://127.0.0.1:8880/api/v1/docs/{pk} with the following body
Then call http://localhost:8880/api/v1/docs/search to search for the new text
Find attached the postman collection to all the endpoints Here how to get the access token |
@apssouza22 My advice to you: pm.sendRequest({
url: "http://localhost:8880/api/v1/admin/user/login",
method: 'POST',
header: {
'content-type': 'application/json'
},
body: {
mode: 'raw',
raw: JSON.stringify({email: "[email protected]", password: "123"})
}
}, (err, res) => pm.collectionVariables.set("token", res.json().access_token)); |
Currently the output of {
"total": 11,
"data": [
{
"pk": "01HCQMGBSGA8SE52EWNTNTDB5S",
"item_id": 30039,
"item_metadata": {
"pk": "01HCQMGBSG41NATRTPZ2TPRAV2", Note that item and its Before fixing it, I want to make sure that @apssouza22 agrees with me which of the two |
@vporton I agree that the item_metadata pk can be deleted |
This double |
There is no |
I meant that u can delete the whole object and create it again |
That's your new endpoint, right? |
Oh, sorry, right. Apparently I was on a wrong Git branch :-( |
After every query to Do you @apssouza22 have any idea why this may happen? |
@vporton I have simplified the doc structure. Please refer to the latest version. It should be much simpler to edit the docs now |
|
Make sure u are getting from the right repository. You are probably pulling from your own repo. You need to add a new repository. Run the following
Then |
It still (I don't understand why) deletes a doc instead of updating it on the PUT request. |
Sorry, I screwed up the |
Or you @apssouza22 screwed it? How come that you deleted We need to communicate in words before further trying to edit it together. |
I think, we should revert to my commit I apologize for my mistakes, I don't have much experience in merging teamwork. |
@apssouza22 I can't work on this until coordinating with you: revert to my commit |
Just delete and create another one as part of update. It should be very easy since we have those operations already |
Delete and create another what? (branch?) Maybe, better to use |
Docs update. The thing u were trying to do here
…On Mon 16 Oct 2023, 19:13 mathematician, ***@***.***> wrote:
delete and create another one
Delete and create another what? (branch?)
Maybe, better to use git revert?
—
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC3RWO73Y5T5PFAVQUVWWTX7V2NJAVCNFSM6AAAAAA52UT4AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRVGAZTONJZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sorry, I am sometimes a little dislexic. I don't understand what you refer to by "docs update" and "the thing". Is it OK for you if I do |
I don't care what git command u use in your repository. Before we merge it.
It lives in your repository
I am talking about the functionality you were trying to implement - Update
docs
…On Mon 16 Oct 2023, 19:25 mathematician, ***@***.***> wrote:
Docs update. The thing u were trying to do here
Sorry, I am sometimes a little dislexic. I don't understand what you refer
to by "docs update" and "the thing".
Is it OK for you if I do git revert?
—
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC3RWJ3KGEQI5TCCXZWW4DX7V3X5AVCNFSM6AAAAAA52UT4AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRVGA2TGOJQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
c205bd4
to
3fe1b6a
Compare
OK, it seems I now understand what happened: I did some changes and after this you applied a patch ( So, to put this in order, I did on my copy of repository After this I removed Now I am starting testing anew. Please, don't screw it again like that patch. |
That is real life flow. We changed the same files and it will cause conflict. U need to pull the latest version, fix the conflicts and push your version. There was no patch. There were new commits to the repo, as it has to be. If u are not able to fix the conflicts, I suggest starting with a new Branch |
Oh, I did something wrong and my Not that bad, I will re-create the branch from |
This time it was easy. The But note that despite of your comment |
@vporton I will test this and if it works fine I will merge it |
API (
PUT
- is it a good choice?) for updating a doc.Not tested. Please either test or explain me which part of the UI to use for testing.