Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1455 +/- ##
==========================================
+ Coverage 69.22% 69.29% +0.06%
==========================================
Files 363 364 +1
Lines 28479 28713 +234
==========================================
+ Hits 19715 19896 +181
- Misses 7893 7925 +32
- Partials 871 892 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds request-scoped attachments to AI prompt/stream calls so images/files can be sent with the active user turn (including tool-call follow-ups) without persisting binary data in the conversation history.
Changes:
- Introduces
Attachment/AttachmentKindcontracts and plumbs attachments throughAgentPrompt. - Adds per-call
PromptOptions (model, attachments, middlewares) and updatesConversation.Prompt/Streamto accept them. - Extends the OpenAI provider to emit multimodal user content parts for image/file attachments, with accompanying test coverage.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
mocks/ai/PromptOptionFunc.go |
Adds mock for prompt option function type. |
mocks/ai/PromptOption.go |
Adds mock for PromptOption. |
mocks/ai/Conversation.go |
Updates mock conversation Prompt/Stream to accept variadic PromptOption. |
mocks/ai/Attachment.go |
Adds mock for Attachment. |
contracts/ai/provider.go |
Extends AgentPrompt with Attachments. |
contracts/ai/option.go |
Adds PromptOptions/PromptOption and adapts Option for prompt-scoped use. |
contracts/ai/attachment.go |
Introduces attachment contract types. |
contracts/ai/ai.go |
Updates conversation interface to accept prompt options. |
ai/option.go |
Adds WithAttachment(s) and nil-filter helpers for attachments. |
ai/openai/provider.go |
Builds multimodal OpenAI messages including image/file parts. |
ai/openai/provider_test.go |
Adds tests validating message building with attachments. |
ai/conversation.go |
Applies per-call prompt options and keeps attachments request-scoped across tool loops/streams. |
ai/conversation_test.go |
Adds tests ensuring attachments aren’t persisted and are kept on tool follow-ups. |
ai/attachment.go |
Adds attachment constructors/resolvers for bytes/readers/paths/storage with lazy resolution. |
ai/attachment_test.go |
Adds tests for attachment constructors and caching behavior. |
hwbrzzl
commented
Apr 28, 2026
hwbrzzl
commented
Apr 28, 2026
hwbrzzl
commented
Apr 28, 2026
hwbrzzl
commented
Apr 28, 2026
Contributor
Author
hwbrzzl
left a comment
There was a problem hiding this comment.
Addressed the latest attachment API review feedback.
hwbrzzl
commented
Apr 28, 2026
hwbrzzl
commented
Apr 28, 2026
Align attachment naming and option helpers with the reviewed API surface, and bound URL-backed attachments to avoid unbounded memory usage.
hwbrzzl
commented
Apr 29, 2026
hwbrzzl
commented
Apr 29, 2026
hwbrzzl
commented
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aipackage with helper constructors likeai.DocumentFromPath(...)andai.ImageFromPath(...).Closes goravel/goravel#918
Why
AI conversations can now include files or images on a single prompt call without changing agent construction or storing binary data in message history. The public attachment API now lives in the root
aipackage, so callers can attach documents and images directly from common sources on each prompt or stream call.