Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce8b98a

Browse files
authored
Fix OpenAI AudioUrl (pydantic#1594)
1 parent56b07ae commitce8b98a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ async def _map_user_prompt(part: UserPromptPart) -> chat.ChatCompletionUserMessa
444444
response=awaitclient.get(item.url)
445445
response.raise_for_status()
446446
base64_encoded=base64.b64encode(response.content).decode('utf-8')
447-
audio=InputAudio(data=base64_encoded,format=response.headers.get('content-type'))
447+
audio_format:Any=response.headers['content-type'].removeprefix('audio/')
448+
audio=InputAudio(data=base64_encoded,format=audio_format)
448449
content.append(ChatCompletionContentPartInputAudioParam(input_audio=audio,type='input_audio'))
449450
elifisinstance(item,DocumentUrl):
450451
client=cached_async_http_client()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp