1515
1616########################################################################################################################
1717#
18- # The code in this section contains the primitive of this new chat API. The `Tool` class defines tools that the model
19- # can predict. The `Message` class defines the container for storing the chat messages.
18+ # The code in this section contains the primitive of this new chat API. The `` Tool` ` class defines tools that the model
19+ # can predict. The `` Message` ` class defines the container for storing the chat messages.
2020#
2121########################################################################################################################
2222
@@ -133,7 +133,7 @@ def __init__(
133133 ** kwargs ,
134134 ):
135135 if role not in self .KNOWN_ROLES :
136- raise ValueError (f"Unknown role: { role } . Update dictionary `KNOWN_ROLES`" )
136+ raise ValueError (f"Unknown role: { role } . Update dictionary `` KNOWN_ROLES` `" )
137137 if value is None :
138138 raise ValueError ("value cannot be None" )
139139
@@ -188,12 +188,15 @@ def to_dict(
188188 self ,
189189 format : Optional [str ] = None ,
190190 meta : bool = False ,
191- ): # ft: bool = False
191+ ):
192192 """
193- if format == `ft` then export to following format: `{"from": "system/human/gpt", "value": "..."}`
194- elif format == `api` then `{"role": "system/user/assistant", "content": [{"type": "text", "text": {"value": "..."}]}`
195- elif format == `full` then `{"id": 1234421123, "role": "system/user/assistant", "content": [{"type": "text", "text": {"value": "..."}]}`
196- else export to following format: `{"role": "system/user/assistant", "content": "..."}`
193+ if format == ``ft`` then export to following format: ``{"from": "system/human/gpt", "value": "..."}``
194+
195+ elif format == ``api`` then ``{"role": "system/user/assistant", "content": [{"type": "text", "text": {"value": "..."}]}``
196+
197+ elif format == ``full`` then ``{"id": 1234421123, "role": "system/user/assistant", "content": [{"type": "text", "text": {"value": "..."}]}``
198+
199+ else export to following format: ``{"role": "system/user/assistant", "content": "..."}``
197200 """
198201 role = self .role
199202
@@ -699,7 +702,7 @@ def undo(self) -> "ThreadsTree":
699702
700703 def pick (self , to : Message = None , from_ : Message = None ) -> Thread :
701704 """
702- Get a thread from the Tree srtucture by telling `to` and `from_` in the tree
705+ Get a thread from the Tree srtucture by telling `` to`` and `` from_` ` in the tree
703706 """
704707 if self .system :
705708 thread = Thread (system (self .system ))
@@ -772,7 +775,7 @@ def regenerate_stream(
772775 # if we are regenerating for a human, then we need to add a prompt to the tree and then regenerate
773776 if not prompt :
774777 raise ValueError (
775- f"Regenerating for role 'human' but no `prompt` provided. pass `prompt`"
778+ f"Regenerating for role 'human' but no `` prompt`` provided. pass `` prompt` `"
776779 )
777780 if type (prompt ) == str :
778781 prompt = human (prompt )
@@ -786,7 +789,7 @@ def regenerate_stream(
786789 # to be a human
787790 if prompt :
788791 raise ValueError (
789- f"Regenerating for role 'gpt' but `prompt` provided. remove `prompt`"
792+ f"Regenerating for role 'gpt' but `` prompt`` provided. remove `` prompt` `"
790793 )
791794 thread = Thread ()
792795 for x in self .tree .find (data_id = from_ .id ).get_parent_list ():
@@ -939,7 +942,7 @@ def create_te_split(
939942 try :
940943 import numpy as np
941944 except ImportError :
942- raise ImportError ("Install numpy to use `create_te_split` method" )
945+ raise ImportError ("Install numpy to use `` create_te_split` ` method" )
943946
944947 train_ds = ThreadsList ()
945948 eval_ds = ThreadsList ()
0 commit comments