fix(examples): update client usage to prefer await aclose() in async context" (#2839)

This commit is contained in:
huhao0926
2025-07-13 16:58:46 +08:00
committed by GitHub
parent 0ecfeabd8e
commit f364d10fb1
6 changed files with 44 additions and 20 deletions

View File

@@ -83,8 +83,12 @@ async def main():
}
],
)
data = await run_evaluation(client, request=request)
print(data)
try:
data = await run_evaluation(client, request=request)
print(data)
finally:
# explicitly close client to avoid event loop closed error
await client.aclose()
if __name__ == "__main__":