-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace actual processor by the pipeline - part3
- Loading branch information
Showing
12 changed files
with
160 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/askai/core/processors/splitter/splitter_result.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
from dataclasses import dataclass, field | ||
|
||
from askai.core.enums.acc_color import AccColor | ||
from askai.core.model.acc_response import AccResponse | ||
from askai.core.model.action_plan import ActionPlan | ||
from askai.core.model.model_result import ModelResult | ||
|
||
|
||
@dataclass | ||
class PipelineResponse: | ||
"""TODO""" | ||
query: str | ||
answer: str | None = None | ||
accuracy: AccResponse | None = None | ||
|
||
|
||
@dataclass | ||
class SplitterResult: | ||
"""TODO""" | ||
question: str | ||
responses: list[PipelineResponse] = field(default_factory=list) | ||
plan: ActionPlan | None = None | ||
model: ModelResult | None = None | ||
|
||
def final_response(self) -> str: | ||
"""TODO""" | ||
return os.linesep.join( | ||
list(map(lambda r: r.answer, filter( | ||
lambda acc: acc.accuracy and acc.accuracy.acc_color.passed(AccColor.MODERATE), self.responses))) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.