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 Text-Generation Task Schema to Align with OpenAI Standards #243

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

tonywang10101
Copy link
Contributor

@tonywang10101 tonywang10101 commented Dec 21, 2023

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.

@tonywang10101 tonywang10101 merged commit cd1acb9 into main Dec 22, 2023
2 checks passed
@tonywang10101 tonywang10101 deleted the INS-2982 branch December 22, 2023 07:28
tonywang10101 added a commit to instill-ai/model-backend that referenced this pull request Dec 25, 2023
…Standards (#479)

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](https://linear.app/instill-ai/issue/INS-2982/harmonizing-the-text-generation-tasks-protocol-buffer-with-the-openai),
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](https://linear.app/instill-ai/issue/INS-2954/improve-param-value-filed-type).

3. **Protobuf Structure Update**: In line with the recent
[commit](instill-ai/protobufs@61c3ca8)
to our protobuf repository, we have migrated the `model owner` and `org`
fields to a new unified `owner` field, ensuring consistency across our
models.


Related changes

- [protobuf PR](instill-ai/protobufs#243). After
this PR merged, we needs to update go mod here
- SDK (WIP)
heiruwu pushed a commit to instill-ai/python-sdk that referenced this pull request Dec 25, 2023
…Standards (#69)

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](https://linear.app/instill-ai/issue/INS-2982/harmonizing-the-text-generation-tasks-protocol-buffer-with-the-openai),
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](https://linear.app/instill-ai/issue/INS-2954/improve-param-value-filed-type).

3. **Protobuf Structure Update**: In line with the recent
[commit](instill-ai/protobufs@61c3ca8)
to our protobuf repository, we have migrated the `model owner` and `org`
fields to a new unified `owner` field, ensuring consistency across our
models.


Related changes

- [protobuf PR](instill-ai/protobufs#243)
- [model backed
PR](instill-ai/model-backend#479)
heiruwu pushed a commit to instill-ai/python-sdk that referenced this pull request Dec 25, 2023
…Standards (#69)

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](https://linear.app/instill-ai/issue/INS-2982/harmonizing-the-text-generation-tasks-protocol-buffer-with-the-openai),
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](https://linear.app/instill-ai/issue/INS-2954/improve-param-value-filed-type).

3. **Protobuf Structure Update**: In line with the recent
[commit](instill-ai/protobufs@61c3ca8)
to our protobuf repository, we have migrated the `model owner` and `org`
fields to a new unified `owner` field, ensuring consistency across our
models.


Related changes

- [protobuf PR](instill-ai/protobufs#243)
- [model backed
PR](instill-ai/model-backend#479)
tonywang10101 added a commit that referenced this pull request Dec 29, 2023
…field (#246)

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](https://linear.app/instill-ai/issue/INS-2982/harmonizing-the-text-generation-tasks-protocol-buffer-with-the-openai),
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](https://linear.app/instill-ai/issue/INS-2954/improve-param-value-filed-type).


3. This PR is based on the basis
[PR-243](#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](https://instill-ai.slack.com/archives/C016F66FX9Q/p1703830216129909?thread_ts=1703822336.034739&cid=C016F66FX9Q)
to get more informations

---------

Co-authored-by: droplet-bot <[email protected]>
heiruwu pushed a commit to instill-ai/python-sdk that referenced this pull request Jan 4, 2024
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](https://linear.app/instill-ai/issue/INS-2982/harmonizing-the-text-generation-tasks-protocol-buffer-with-the-openai),
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](https://linear.app/instill-ai/issue/INS-2954/improve-param-value-filed-type).


3. This PR is based on the basis
[PR-243](instill-ai/protobufs#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](https://instill-ai.slack.com/archives/C016F66FX9Q/p1703830216129909?thread_ts=1703822336.034739&cid=C016F66FX9Q)
to get more informations
heiruwu pushed a commit to instill-ai/model-backend that referenced this pull request Jan 8, 2024
… field (#481)

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](https://linear.app/instill-ai/issue/INS-2982/harmonizing-the-text-generation-tasks-protocol-buffer-with-the-openai),
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](https://linear.app/instill-ai/issue/INS-2954/improve-param-value-filed-type).


3. This PR is based on the basis
[PR-243](instill-ai/protobufs#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](https://instill-ai.slack.com/archives/C016F66FX9Q/p1703830216129909?thread_ts=1703822336.034739&cid=C016F66FX9Q)
to get more informations

---------

Signed-off-by: tony.wang.10101 <[email protected]>
Co-authored-by: Chang, Hui-Tang <[email protected]>
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