feat: upgrade openai 1.x

This commit is contained in:
莘权 马 2023-12-18 11:31:08 +08:00
parent a9479843f6
commit 41361915a1
11 changed files with 35 additions and 26 deletions

View file

@ -56,3 +56,7 @@ async def test_publish_and_process_message(env: Environment):
await env.run(k=2)
logger.info(f"{env.history=}")
assert len(env.history) > 10
if __name__ == "__main__":
pytest.main([__file__, "-s"])

View file

@ -54,5 +54,5 @@ class TestGPT:
assert costs.total_cost > 0
# if __name__ == "__main__":
# pytest.main([__file__, "-s"])
if __name__ == "__main__":
pytest.main([__file__, "-s"])

View file

@ -35,5 +35,5 @@ async def test_llm_acompletion(llm):
assert len(await llm.acompletion_batch_text([hello_msg])) > 0
# if __name__ == "__main__":
# pytest.main([__file__, "-s"])
if __name__ == "__main__":
pytest.main([__file__, "-s"])

View file

@ -26,3 +26,7 @@ async def test_team():
# def test_startup():
# args = ["Make a 2048 game"]
# result = runner.invoke(app, args)
if __name__ == "__main__":
pytest.main([__file__, "-s"])

View file

@ -100,3 +100,7 @@ async def test_subscription_run_error(loguru_caplog):
logs = "".join(loguru_caplog.messages)
assert "run error" in logs
assert "has completed" in logs
if __name__ == "__main__":
pytest.main([__file__, "-s"])