Skip to content

Conversation

@ViaSocket-Git
Copy link
Collaborator

added audio model of openai

Copy link
Collaborator

@harshhsahu harshhsahu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

history me user_urls me history
{
url, type}

result = await image(data_to_send)
return result
if type == 'audio':
loop = asyncio.get_event_loop()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loop kyu bna rhe h?

type = data_to_send.get("body",{}).get('configuration',{}).get('type')
if type == 'embedding':
loop = asyncio.get_event_loop()
result = await loop.run_in_executor(executor, lambda: asyncio.run(embedding(data_to_send)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yaha bhe kyu looop me run krna h openai aynsc chalta h

self.function_time_logs = params.get('function_time_logs')
self.files = params.get('files') or []
self.file_data = params.get('file_data')
self.audio_file = params.get('audio_file')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_data, file check kro and isme hi audio send krne ka option hona chahiye.
and cmt dal dena ki file and file_data kya h


async def OpenAIAudioModel(configuration, apiKey, execution_time_logs, timer, audio_file):
try:
openai_config = AsyncOpenAI(api_key=apiKey)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rearrage the code

Comment on lines +187 to +188
"file_data" : body.get('file_data') or body.get('video_data') or {},
"audio_file" : body.get('audio_file') or {},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants