Skip to content

Commit

Permalink
Grumble: still working on context (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
signebedi committed May 25, 2023
1 parent 59d77ba commit 3926dd7
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions gptty/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ def fetch_response(self, prompt: Union[str, List[Dict[str, str]]], max_tokens: O

def build_context(self,
prompt: str,
context: List[Dict[str, str]],
max_context_length: int,
tag: str = "",
context: List[Dict[str, str]] = "",
max_context_length: int = None,
model_type: Optional[str] = None,
context_keywords_only: bool = True,
context_keywords_only: bool = None,
additional_context: str = "",
) -> Union[str, List[Dict[str, str]]]:
"""
Expand All @@ -302,4 +303,18 @@ def build_context(self,
Union[str, List[Dict[str, str]]]: If `model_type` is 'v1/chat/completions', returns a list of dicts with
'role' and 'content' keys. If not, returns a string.
"""
pass

model_type = model_type if model_type is not None else self.validate_model_type(self.model)
max_context_length = max_context_length if max_context_length is not None else self.max_context_length
context_keywords_only = context_keywords_only if context_keywords_only is not None else self.context_keywords_only

return context.get_context()

# def get_context(tag: str = "",
# max_context_length: int,
# output_file: str,
# model_name:str,
# context_keywords_only: bool = True,
# additional_context: str = "",
# model_type: str = None,
# question: str = None)

0 comments on commit 3926dd7

Please sign in to comment.