Skip to content

Commit 55fce2e

Browse files
committed
Fix slotted-adapter planning and offline Anthropic media previews
Signed-off-by: Maxime Rivest <mrive052@gmail.com>
1 parent b51852e commit 55fce2e

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

‎lm15/providers/common.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ def anthropic_source(part: ImagePart | DocumentPart | BinaryPart) -> dict[str, A
364364
if part.data is not None:
365365
return {"type": "base64", "media_type": part.media_type, "data": part.data}
366366
if part.path is not None:
367-
data = base64.b64encode(part.path.read_bytes()).decode("ascii")
368-
return {"type": "base64", "media_type": part.media_type, "data": data}
367+
return {"type": "base64", "media_type": part.media_type, "data": media_base64(part)}
369368
raise ValueError(f"{part.type} part has no usable source")
370369

371370

‎lm15/providers/openai_chat.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ def plan(self, request: Request, *, policy: AdaptationPolicy | None = None) -> "
18831883
wire_request = self._wire_request(request)
18841884
if self._judgments_via_token_scoring(wire_request):
18851885
return self._judgment_adaptations(wire_request, policy=policy)
1886-
return super().plan(request, policy=policy)
1886+
return BaseProviderLM.plan(self, request, policy=policy)
18871887

18881888
def complete(self, request: Request) -> Response:
18891889
wire_request = self._wire_request(request)

0 commit comments

Comments
 (0)