Skip to content

Commit

Permalink
fix: add missing await
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Nov 26, 2023
1 parent 27abf08 commit 9156414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/promplate/llm/openai/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __call__(self, text: str, /, **config):
class AsyncTextGenerate(Config):
async def __call__(self, text: str, /, **config):
config = config | {"stream": True, "prompt": text}
stream = self.aclient.completions.create(**config)
stream = await self.aclient.completions.create(**config)
async for event in stream:
yield event.choices[0].text

Expand Down Expand Up @@ -99,6 +99,6 @@ class AsyncChatGenerate(Config):
async def __call__(self, messages: list[Message] | str, /, **config):
messages = ensure(messages)
config = config | {"stream": True, "messages": messages}
stream = self.aclient.chat.completions.create(**config)
stream = await self.aclient.chat.completions.create(**config)
async for event in stream:
yield event.choices[0].delta.content
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "promplate"
version = "0.3.0a1"
version = "0.3.0a2"
description = "cross-language prompt engineering framework"
homepage = "https://promplate.dev/"
repository = "https://github.com/promplate/core"
Expand Down

0 comments on commit 9156414

Please sign in to comment.