Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

asyncio #31

wants to merge 2 commits into from

Conversation

bwl0211
Copy link
Collaborator

@bwl0211 bwl0211 commented May 29, 2024

No description provided.

Signed-off-by: bwl <[email protected]>
code = content['header']['code']
logger.debug(f"sid: {content['header']['sid']}, code: {code}")
if code != 0:
logger.error(content['header']['message'])
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 如果这里错误不为0,不用continune
  • 不要print

Copy link
Contributor

Choose a reason for hiding this comment

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

这里 code不为 应该无法走后门的逻辑了,可以本地模拟下错误,比如传一个错误的数据类型看下这里报错如何,测试下

if "usage" in data:
final_frame = True
llm_output["token_usage"] = data['usage']['text']
if 'text' not in data['choices'] and not final_frame:
Copy link
Contributor

Choose a reason for hiding this comment

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

usage和text确定是在两帧返回吗?确认下

)
return aws
except websockets.ConnectionClosed as e:
print(f"Connection closed unexpectedly:{e}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Print...

except websockets.ConnectionClosed as e:
print(f"Connection closed unexpectedly:{e}")
except Exception as e:
print(f"An error occurred: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

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

print..

Signed-off-by: bwl <[email protected]>
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.

2 participants