Skip to content

Add ChatMessageContent type to support image_url content#23

Open
mlang wants to merge 2 commits into
agrafix:mainfrom
mlang:image_url
Open

Add ChatMessageContent type to support image_url content#23
mlang wants to merge 2 commits into
agrafix:mainfrom
mlang:image_url

Conversation

@mlang

@mlang mlang commented Dec 12, 2023

Copy link
Copy Markdown
Contributor
  • Add ChatMessageContent type to support image_url content
  • Support the image_url detail parameter

A.object [ "type" A..= ("image_url" :: T.Text),
"image_url" A..= case d of
Nothing -> A.String u
Just detail -> A.object [ "url" A..= u,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where did you find this? I don't see it in the API docs below but perhaps I'm looking in the wrong place?
image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nevermind I found it! I needed to keep clicking the dropdowns - apologies!

@nickhs nickhs Mar 23, 2024

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and from the vision guide it looks like its an enum of high, low, and auto. Thoughts on making it an enum?

https://platform.openai.com/docs/guides/vision

go xs' = A.Array . V.fromList $ map A.toJSON xs'

data ChatMessageContentPart = CMCP_Text T.Text
| CMCP_Image { imageUrl :: T.Text, imageDetail :: Maybe T.Text }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

supernit: can be CMCPImageUrl?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants