Skip to content

Commit 34221ef

Browse files
committed
address comments
1 parent b2e7ab8 commit 34221ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/backend/approaches/chatreadretrieveread.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ def get_chat_history_as_text(self, history: Sequence[dict[str, str]], include_la
115115
break
116116
return history_text
117117

118-
# Generate messages needed for chat Completion api
119118
def get_messages_from_history(self, prompt_override, follow_up_questions_prompt, history: Sequence[dict[str, str]], sources: str, approx_max_tokens: int = 1000) -> []:
119+
'''
120+
Generate messages needed for chat Completion api
121+
'''
120122
messages = []
121123
token_count = 0
122124
if prompt_override is None:
@@ -160,7 +162,7 @@ def num_tokens_from_messages(self, message: dict[str,str], model: str) -> int:
160162
Returns:
161163
int: The total number of tokens required to encode the message.
162164
Example:
163-
message = {'role': 'user', 'name': 'John', 'content': 'Hello, how are you?'}
165+
message = {'role': 'user', 'content': 'Hello, how are you?'}
164166
model = 'gpt-3.5-turbo'
165167
num_tokens_from_messages(message, model)
166168
output: 11

0 commit comments

Comments
 (0)