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

chore(model): adopt latest protobuf for chat_history schema change #72

Merged
merged 1 commit into from
Jan 4, 2024

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

codecov bot commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ff57518) 34.43% compared to head (5e61058) 34.43%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #72   +/-   ##
=======================================
  Coverage   34.43%   34.43%           
=======================================
  Files          25       25           
  Lines        1658     1658           
  Branches      419      419           
=======================================
  Hits          571      571           
  Misses       1070     1070           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tonywang10101 tonywang10101 changed the title feat(model): update chat_history schema to align with OpenAI message field chore(model): update chat_history schema to align with OpenAI message field Dec 29, 2023
@heiruwu heiruwu force-pushed the main branch 2 times, most recently from b0da8db to b6e8ea0 Compare January 1, 2024 19:25
@heiruwu heiruwu changed the title chore(model): update chat_history schema to align with OpenAI message field chore(model): adopt latest protobuf for chat_history schema change Jan 4, 2024
@heiruwu heiruwu merged commit 903bc29 into main Jan 4, 2024
11 checks passed
@heiruwu heiruwu deleted the INS-2982 branch January 4, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: 👋 Done
Development

Successfully merging this pull request may close these issues.

3 participants