From 74e5c067e5b21507a57077ff0d69f42baa9f4537 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 1 Jun 2024 11:29:08 -0700 Subject: [PATCH] example: fc scaffold --- examples/function_calling_scaffold.py | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 examples/function_calling_scaffold.py diff --git a/examples/function_calling_scaffold.py b/examples/function_calling_scaffold.py new file mode 100644 index 0000000..aae6e50 --- /dev/null +++ b/examples/function_calling_scaffold.py @@ -0,0 +1,28 @@ +from blueprints.function_calling_blueprint import Pipeline as FunctionCallingBlueprint + + +class Pipeline(FunctionCallingBlueprint): + class Valves(FunctionCallingBlueprint.Valves): + # Add your custom parameters here + pass + + class Tools: + def __init__(self, pipeline) -> None: + self.pipeline = pipeline + + # Add your custom tools here + # Please refer to function_calling_filter_pipeline.py for an example + # Pure Python code can be added here + pass + + def __init__(self): + super().__init__() + self.id = "my_tools_pipeline" + self.name = "My Tools Pipeline" + self.valves = self.Valves( + **{ + **self.valves.model_dump(), + "pipelines": ["*"], # Connect to all pipelines + }, + ) + self.tools = self.Tools(self)