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(openai_dart)!: Add multi-modal support #218

Merged
merged 1 commit into from
Nov 15, 2023
Merged

feat(openai_dart)!: Add multi-modal support #218

merged 1 commit into from
Nov 15, 2023

Conversation

davidmigloz
Copy link
Owner

@davidmigloz davidmigloz commented Nov 15, 2023

Breaking changes:

ChatCompletionMessage

  • ChatCompletionMessage is now a sealed class that supports the following message types:
    • ChatCompletionMessage.system(): a system message.
    • ChatCompletionMessage.user(): a user message.
    • ChatCompletionMessage.assistant(): an assistant message.
    • ChatCompletionMessage.tool(): a tool message.
    • ChatCompletionMessage.function(): a function message.

Before:

messages: [
  ChatCompletionMessage(
    role: ChatCompletionMessageRole.system,
    content: 'You are a helpful assistant.',
  ),
  ChatCompletionMessage(
    role: ChatCompletionMessageRole.user,
    content: 'Hello!',
  ),
]

After:

messages: [
  ChatCompletionMessage.system(
    content: 'You are a helpful assistant.',
  ),
  ChatCompletionMessage.user(
    content: ChatCompletionUserMessageContent.string('Hello!'),
  ),
]

ChatCompletionMessage.user content

  • ChatCompletionMessage.user accepts a ChatCompletionUserMessageContent sealed class that can be:
    • ChatCompletionUserMessageContent.string(): text content
    • ChatCompletionUserMessageContent.parts(): multi-modal content

@davidmigloz davidmigloz self-assigned this Nov 15, 2023
@davidmigloz davidmigloz added t:enhancement New feature or request p:openai_dart openai_dart package. labels Nov 15, 2023
@davidmigloz davidmigloz added this to the v0.0.16 milestone Nov 15, 2023
@davidmigloz davidmigloz merged commit 14c8e7e into main Nov 15, 2023
1 check passed
@davidmigloz davidmigloz deleted the multimodal branch November 15, 2023 21:11
KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:openai_dart openai_dart package. t:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant