r"""When we only need the content of the first message. It is the default parser for chat completion.
(completion: ChatCompletion)
| 56 | |
| 57 | # completion parsing functions and you can combine them into one singple chat completion parser |
| 58 | def get_first_message_content(completion: ChatCompletion) -> str: |
| 59 | r"""When we only need the content of the first message. |
| 60 | It is the default parser for chat completion.""" |
| 61 | log.debug(f"raw completion: {completion}") |
| 62 | return completion.choices[0].message.content |
| 63 | |
| 64 | |
| 65 | # def _get_chat_completion_usage(completion: ChatCompletion) -> OpenAICompletionUsage: |
nothing calls this directly
no outgoing calls
no test coverage detected