sashabaranov / go-openai

OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go
Apache License 2.0
9.25k stars 1.42k forks source link

Support Attachments in MessageRequest #890

Closed kodernubie closed 1 week ago

kodernubie commented 2 weeks ago

Describe the change Add Attachments field in MessageRequest struct so we can attach file to thread message and can refer the file in chat content.

Provide OpenAI documentation link https://platform.openai.com/docs/api-reference/messages/createMessage

Describe your solution Adding Attachments Field and tools type const in message.go

Tests using unit test and example app

Additional context

Issue: -

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.86%. Comparing base (774fc9d) to head (b130e7e). Report is 70 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #890 +/- ## ========================================== + Coverage 98.46% 98.86% +0.40% ========================================== Files 24 26 +2 Lines 1364 1761 +397 ========================================== + Hits 1343 1741 +398 + Misses 15 14 -1 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.