| from typing import Dict | |
| class Message(object): | |
| def __init__(self, persona: str, text: str): | |
| self.persona = persona | |
| self.text = text.replace('\n', '\\n') | |
| def __str__(self): | |
| return f"{self.persona}: {self.text}" | |
| def to_gpt_format(self, role_mapping: Dict[str, str]): | |
| return {"role": role_mapping.get(self.persona, "unknown"), "content": self.text} | |
Xet Storage Details
- Size:
- 394 Bytes
- Xet hash:
- c4304c8d6190e3e6b6ca4e26e7f377c005f927ea5918ddfdcee4719245bf4e92
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.