Skip to content

Commit

Permalink
refactor: make invoke public again
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge committed Mar 6, 2024
1 parent c3a6283 commit a7b46f1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _ensure_token_limit(self, prompt: Union[str, List[Dict[str, str]]]) -> Union
)
return str(resize_info["resized_prompt"])

def _invoke(self, *args, **kwargs):
def invoke(self, *args, **kwargs):
"""
Invokes the model with the given prompt.
Expand Down Expand Up @@ -232,7 +232,7 @@ def run(self, prompt: str, generation_kwargs: Optional[Dict[str, Any]] = None):
:raises ValueError: If the prompt is empty or None.
:raises AmazonBedrockInferenceError: If the model cannot be invoked.
"""
return {"replies": self._invoke(prompt=prompt, **(generation_kwargs or {}))}
return {"replies": self.invoke(prompt=prompt, **(generation_kwargs or {}))}

@classmethod
def get_model_adapter(cls, model: str) -> Optional[Type[BedrockModelAdapter]]:
Expand Down

0 comments on commit a7b46f1

Please sign in to comment.