Skip to content

Commit c29e5f3

Browse files
committed
Merge pull request 'chore: remove default base64 message for files' (#437) from base64 into development
Reviewed-on: https://git.biggo.com/Funmula/dive-mcp-host/pulls/437
2 parents 67feaaf + be0fcc0 commit c29e5f3

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

dive_mcp_host/host/agents/file_in_additional_kwargs.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -120,25 +120,6 @@ def create(
120120
return asdict(cls(text=content))
121121

122122

123-
@dataclass(slots=True)
124-
class DocumentBase64Msg:
125-
"""Document base64 message."""
126-
127-
text: str
128-
type: Literal["text"] = "text"
129-
130-
@classmethod
131-
def create(
132-
cls, base64_data: str, file_name: str, content_type: str | None
133-
) -> dict[str, str]:
134-
"""Create base64 document msg."""
135-
if content_type:
136-
data = f"data:{content_type};base64,{base64_data}"
137-
else:
138-
data = base64_data
139-
return asdict(cls(text=f"document {file_name}, base64: {data}"))
140-
141-
142123
OAP_MIN_COUNT = 2
143124

144125

@@ -183,17 +164,8 @@ async def _gen_document_msg(
183164
DocumentInfoMsg.create(path=local_path, url=url, file_name=file_name),
184165
]
185166

186-
# Other file types or providers
187-
return [
188-
DocumentBase64Msg.create(
189-
base64_data=base64_content,
190-
file_name=file_name,
191-
content_type=content_type,
192-
)
193-
if base64_content
194-
else {},
195-
DocumentInfoMsg.create(path=local_path, url=url, file_name=file_name),
196-
]
167+
# Other file types or providers, simply pass the document info message
168+
return [DocumentInfoMsg.create(path=local_path, url=url, file_name=file_name)]
197169

198170
async def _gen_image_msg_oap(
199171
self,

0 commit comments

Comments
 (0)