Skip to content

Commit

Permalink
change citations
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed May 2, 2024
1 parent 8c9c7c0 commit d79f926
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/src/stampy_chat/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def merge_history(history):
messages = []
current_message = history[0]
for message in history[1:]:
if message.get('role') == 'deleted':
if message.get('role') in ['deleted', 'error']:
continue
if message.get('role') != current_message.get('role'):
messages.append(current_message)
Expand Down
2 changes: 1 addition & 1 deletion api/src/stampy_chat/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Config:
@staticmethod
def make_reference(i: int) -> str:
"""Make the reference used in citations - basically translate i -> 'a + i'"""
return chr(i + 97)
return str(i + 1)

def fetch_docs(self, input_variables) -> List:
### Copied from parent - for some reason they ignore the ids of the returned items, so
Expand Down
8 changes: 4 additions & 4 deletions api/src/stampy_chat/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
SOURCE_PROMPT = (
"You are a helpful assistant knowledgeable about AI Alignment and Safety. "
"Please give a clear and coherent answer to the user's questions. (written after \"Q:\") "
"using the following sources. Each source is labeled with a letter. Feel free to "
"use the sources in any order, and try to use multiple sources in your answers.\n\n"
"using the following sources. Each source is labeled with a number. Feel free to "
"use the sources in any order, and try to reference up to 8 sources in your answers.\n\n"
)
HISTORY_PROMPT = (
"\n\n"
Expand All @@ -29,8 +29,8 @@

QUESTION_PROMPT = (
"In your answer, please cite any claims you make back to each source "
"using the format: [a], [b], etc. If you use multiple sources to make a claim "
"cite all of them. For example: \"AGI is concerning [c, d, e].\"\n\n"
"using the format: [1], [2], etc. If you use multiple sources to make a claim "
"cite all of them. For example: \"AGI is concerning [1, 3, 8].\"\n\n"
)
PROMPT_MODES = {
'default': "",
Expand Down

0 comments on commit d79f926

Please sign in to comment.