-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP connector usage in pipelines and components
- Loading branch information
1 parent
dad5336
commit ee797da
Showing
6 changed files
with
42 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from healthchain.pipeline.components.basecomponent import Component | ||
from healthchain.io.containers import Document | ||
from typing import TypeVar, Generic | ||
|
||
T = TypeVar("T") | ||
|
||
|
||
# TODO: implement this class | ||
class LLM(Component[T], Generic[T]): | ||
def __init__(self, model_name: str): | ||
self.model = model_name | ||
|
||
def load_model(self): | ||
pass | ||
|
||
def load_chain(self): | ||
pass | ||
|
||
def __call__(self, doc: Document) -> Document: | ||
return doc |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from healthchain.io.cdsfhirconnector import CdsFhirConnector | ||
from healthchain.pipeline.basepipeline import Pipeline | ||
from healthchain.pipeline.components.llm import LLM | ||
|
||
|
||
# TODO: Implement this pipeline in full | ||
class SummarizationPipeline(Pipeline): | ||
def configure_pipeline(self, model_name: str) -> None: | ||
cds_fhir_connector = CdsFhirConnector(hook_name="encounter-discharge") | ||
self.add_input(cds_fhir_connector) | ||
|
||
# Add summarization component | ||
llm = LLM(model_name) | ||
self.add(llm, stage="summarization") | ||
|
||
# Maybe you can have components that create cards | ||
# self.add(CardCreator(), stage="card-creation") | ||
|
||
self.add_output(cds_fhir_connector) |