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

Endpoint PUT conversation history #896

Open
pieroit opened this issue Aug 26, 2024 · 7 comments
Open

Endpoint PUT conversation history #896

pieroit opened this issue Aug 26, 2024 · 7 comments
Assignees
Labels
endpoints Related to http / ws endpoints enhancement New feature or request

Comments

@pieroit
Copy link
Member

pieroit commented Aug 26, 2024

As suggeste in #889 , we could add an endpoint to impose a convo history.
(GET and DELETE already exists).

As for the payload, not sure if we can have a custom Pydantic model replicating this structure:

{
    "who": who,
    "message": message,
    "why": why,
    "when": time.time(),
    "role": Role.AI if who == "AI" else Role.Human,
}

Or try to reuse the objects already established to deal with conversation turns:

  • CatMessage
  • UserMessage
    (see here)
@pieroit pieroit added enhancement New feature or request endpoints Related to http / ws endpoints labels Aug 26, 2024
@valentimarco valentimarco moved this to 📋 Backlog in Cat Project Kanban Aug 26, 2024
@dave90
Copy link
Contributor

dave90 commented Sep 26, 2024

I’d like to work on this issue . Could you please assign it to me?

@pieroit
Copy link
Member Author

pieroit commented Sep 26, 2024

I’d like to work on this issue . Could you please assign it to me?

Thanks @dave90, I'm not sure about the data model here. What do you suggest?
We can mock internal objects like I suggested above or align convo history with the openai/ollama standard

Assigned to you, but please let's design before writing ;)

@dave90
Copy link
Contributor

dave90 commented Sep 27, 2024

I think that the best solution is using :

{
    "who": who,
    "message": message,
    "why": why,
    "when": time.time(),
    "role": Role.AI if who == "AI" else Role.Human,
}

This format ensures consistency with the objects that are returned in the GET /conversation_history endpoint.

@dave90
Copy link
Contributor

dave90 commented Oct 24, 2024

I think the best approach would be to use the following Pydantic class model for the endpoint PUT /conversation_history:

class HistoryMessage(BaseModel):
    who:str
    message:str
    why: Dict 

What do you think @pieroit ?

@pieroit
Copy link
Member Author

pieroit commented Nov 6, 2024

I think the best approach would be to use the following Pydantic class model for the endpoint PUT /conversation_history:

class HistoryMessage(BaseModel):
    who:str
    message:str
    why: Dict 

What do you think @pieroit ?

Hi @dave90 thanks and sorry for the dealy
Have a look at the vision branch, @Pingdred is adding support for images and made a tweak on those structures

After that, do as you whish on this endpoint, we can have it without documenting it, trying it out, when we are ready we document it

Also please note from the next release on it will be possible to add custom endpoints (#964 ), so in the next months we can focus on having fewer endpoints, but more solid and with types - in line with the work you started months ago ;)

@dave90
Copy link
Contributor

dave90 commented Nov 15, 2024

I think the best approach would be to use the following Pydantic class model for the endpoint PUT /conversation_history:

class HistoryMessage(BaseModel):
    who:str
    message:str
    why: Dict 

What do you think @pieroit ?

Hi @dave90 thanks and sorry for the dealy Have a look at the vision branch, @Pingdred is adding support for images and made a tweak on those structures

After that, do as you whish on this endpoint, we can have it without documenting it, trying it out, when we are ready we document it

Also please note from the next release on it will be possible to add custom endpoints (#964 ), so in the next months we can focus on having fewer endpoints, but more solid and with types - in line with the work you started months ago ;)

Hi @pieroit thanks for the update!
Regarding the multimodality PR (#967), I noticed the change to the history list type in WorkingMemory. So in my opinion, it makes sense to wait for that to merge before starting on the new PUT history endpoint to maintain consistency with the updated data type.

@pieroit
Copy link
Member Author

pieroit commented Nov 18, 2024

Hi @pieroit thanks for the update! Regarding the multimodality PR (#967), I noticed the change to the history list type in WorkingMemory. So in my opinion, it makes sense to wait for that to merge before starting on the new PUT history endpoint to maintain consistency with the updated data type.

Ok sounds the right strategy.
Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
endpoints Related to http / ws endpoints enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants