Skip to content

Commit

Permalink
Add _make_system_content method
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin committed Feb 1, 2024
1 parent 16ddbc0 commit 17264a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ragna/assistants/_ai21labs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from enum import Enum, unique

from ragna.core import Source

from ._api import ApiAssistant


Expand All @@ -22,3 +24,11 @@ def display_name(cls) -> str:
@property
def max_input_size(self) -> int:
return self._CONTEXT_SIZE

def _make_system_content(self, sources: list[Source]) -> str:
instruction = (
"You are a helpful assistant that answers user questions given the context below. "
"If you don't know the answer, just say so. Don't try to make up an answer. "
"Only use the sources below to generate the answer."
)
return instruction + "\n\n".join(source.content for source in sources)

0 comments on commit 17264a8

Please sign in to comment.