Skip to content

Commit

Permalink
Fix abstract method signature error (run-llama#16809)
Browse files Browse the repository at this point in the history
Co-authored-by: yimao <[email protected]>
  • Loading branch information
yimao and yimao authored Nov 4, 2024
1 parent b987b34 commit 2f07a31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ def _get_input_parameters(
return message, parameters

@llm_completion_callback()
def complete(self, prompt: str, **kwargs: Any) -> CompletionResponse:
def complete(
self, prompt: str, formatted: bool = False, **kwargs: Any
) -> CompletionResponse:
message, parameters = self._get_input_parameters(prompt=prompt, **kwargs)
parameters.pop("incremental_output", None)
parameters.pop("stream", None)
Expand All @@ -265,7 +267,9 @@ def complete(self, prompt: str, **kwargs: Any) -> CompletionResponse:
return dashscope_response_to_completion_response(response)

@llm_completion_callback()
async def acomplete(self, prompt: str, **kwargs: Any) -> CompletionResponse:
async def acomplete(
self, prompt: str, formatted: bool = False, **kwargs: Any
) -> CompletionResponse:
message, parameters = self._get_input_parameters(prompt=prompt, **kwargs)
parameters.pop("incremental_output", None)
parameters.pop("stream", None)
Expand All @@ -279,7 +283,9 @@ async def acomplete(self, prompt: str, **kwargs: Any) -> CompletionResponse:
return dashscope_response_to_completion_response(response)

@llm_completion_callback()
def stream_complete(self, prompt: str, **kwargs: Any) -> CompletionResponseGen:
def stream_complete(
self, prompt: str, formatted: bool = False, **kwargs: Any
) -> CompletionResponseGen:
message, parameters = self._get_input_parameters(prompt=prompt, kwargs=kwargs)
parameters["incremental_output"] = True
parameters["stream"] = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-llms-dashscope"
readme = "README.md"
version = "0.2.3"
version = "0.2.4"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down

0 comments on commit 2f07a31

Please sign in to comment.