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(model): update chat_history schema to align with OpenAI message field #246

Merged
merged 6 commits into from
Dec 29, 2023

Conversation

tonywang10101
Copy link
Contributor

Because ...

  • This update is necessitated by the need to align our current text-generation-task schema more closely with OpenAI's task structure.

This commit ...

  1. Enhancement of TASK_TEXT_GENERATION: Following our discussion in INS-2982, we have introduced three new fields to the TASK_TEXT_GENERATION protocol buffer:

    • An optional system_message string.
    • An optional chat_history field, now mirroring the type used in conversation.
    • An optional image_url string, which is a base64 encoded string including batch dimension.
  2. Improved extra_param Support: To offer enhanced functionality for the extra_param, we have implemented the suggestions in INS-2954.

  3. This PR is based on the basis PR-243 and made some modifications to the chat_history field to align with the OpenAI message field

Based on information provided by Xiaofei, following are patterns of OpenAI message field:

[
    {
        "role": "...", // user, system, assistant
        "content": [...]
    }
]

And inside content:
If it is a text

  {
     "type": "text",
     "text": "What's in this image?"
  },

if it is an image

{
    "type": "image_url",
    "image_url": {
       "url": "< url or base64 >"
    }
}

reference to this slack thread to get more informations

Copy link
Member

@donch1989 donch1989 left a comment

Choose a reason for hiding this comment

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

LGTM

@tonywang10101 tonywang10101 merged commit dcc5ed1 into main Dec 29, 2023
@tonywang10101 tonywang10101 deleted the INS-2982 branch December 29, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 👋 Done
Development

Successfully merging this pull request may close these issues.

3 participants