Skip to content

Commit

Permalink
added assistant_message function
Browse files Browse the repository at this point in the history
  • Loading branch information
phelps-sg committed Nov 17, 2023
1 parent 28a4228 commit 613c4d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/openai_pygenerator/openai_pygenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ def user_message(text: str) -> Completion:
return ChatCompletionUserMessageParam({"role": "user", "content": text})


def assistant_message(text: str) -> Completion:
return ChatCompletionAssistantMessageParam({"role": "assistant", "content": text})


def content(completion: Completion) -> str:
return str(completion["content"])

Expand Down

0 comments on commit 613c4d1

Please sign in to comment.