@@ -93,27 +93,27 @@ Allie FlowKit Python can be run locally or as a Docker container. Follow the ins
93
93
# # Adding custom functions
94
94
95
95
1. ** Create a New Function:**
96
- - Add your function code as an endpoint to a new Python file in the ` app /endpoints` directory.
97
- - Use the ` app /endpoints/splitter.py` file and its endpoints as an example.
96
+ - Add your function code as an endpoint to a new Python file in the ` allie/flowkit /endpoints` directory.
97
+ - Use the ` allie/flowkit /endpoints/splitter.py` file and its endpoints as an example.
98
98
- Explicitly define the input and output of the function using Pydantic models, as these will be used by the Allie Agent to call the function.
99
99
100
100
2. ** Add the models for the function:**
101
- - Create the models for the input and output of the function in the ` app /models` directory.
102
- - Use the ` app /models/splitter.py` file and its models as an example.
101
+ - Create the models for the input and output of the function in the ` allie/flowkit /models` directory.
102
+ - Use the ` allie/flowkit /models/splitter.py` file and its models as an example.
103
103
104
104
3. ** Add the endpoints to the service:**
105
- - Import your module in the ` app/app .py` file and add the router to the service.
105
+ - Import your module in the ` allie/flowkit/flowkit_service .py` file and add the router to the service.
106
106
107
107
4. ** Add the function to the function map:**
108
- - Add your function to the ` function_map` dictionary in the ` app/app .py` file.
108
+ - Add your function to the ` function_map` dictionary in the ` allie/flowkit/flowkit_service .py` file.
109
109
110
110
# ## Example´
111
111
112
112
1. ** Create a new file for all your custom functions:**
113
- - In the ` app /endpoints` directory, create a new Python file named ` custom_endpoint.py` .
113
+ - In the ` allie/flowkit /endpoints` directory, create a new Python file named ` custom_endpoint.py` .
114
114
115
115
2. ** Create the models for the custom function:**
116
- - In the ` app /models` directory, create a new Python file named ` custom_model.py` .
116
+ - In the ` allie/flowkit /models` directory, create a new Python file named ` custom_model.py` .
117
117
118
118
** custom_model.py** :
119
119
` ` ` python
@@ -152,7 +152,7 @@ Allie FlowKit Python can be run locally or as a Docker container. Follow the ins
152
152
** custom_endpoint.py** :
153
153
` ` ` python
154
154
from fastapi import FastAPI, APIRouter
155
- from app .models.custom_model import CustomRequest, CustomResponse
155
+ from allie.flowkit .models.custom_model import CustomRequest, CustomResponse
156
156
157
157
158
158
@router.post(" /custom_function" , response_model=CustomResponse)
@@ -176,22 +176,22 @@ Allie FlowKit Python can be run locally or as a Docker container. Follow the ins
176
176
` ` `
177
177
178
178
4. ** Import the module and add the router to the service:**
179
- - Import the module in the ` ` app/app .py` ` file and add the router to the service.
179
+ - Import the module in the ` ` allie/flowkit/flowkit_service .py` ` file and add the router to the service.
180
180
181
- ** app .py** :
181
+ ** flowkit_service .py** :
182
182
` ` ` python
183
- from app .endpoints import custom_endpoint
183
+ from allie.flowkit .endpoints import custom_endpoint
184
184
185
- app .include_router(splitter.router, prefix=" /splitter" , tags=[" splitter" ])
186
- app .include_router(
185
+ flowkit_servie .include_router(splitter.router, prefix=" /splitter" , tags=[" splitter" ])
186
+ flowkit_servie .include_router(
187
187
custom_endpoint.router, prefix=" /custom_endpoint" , tags=[" custom_endpoint" ]
188
188
)
189
189
` ` `
190
190
191
191
5. ** Add the function to the function map:**
192
- - Add your function to the ` ` function_map` ` dictionary in the ` ` app/app .py` ` file.
192
+ - Add your function to the ` ` function_map` ` dictionary in the ` ` allie/flowkit/flowkit_service .py` ` file.
193
193
194
- ** app .py** :
194
+ ** flowkit_service .py** :
195
195
` ` ` python
196
196
function_map = {
197
197
" split_ppt" : splitter.split_ppt,
0 commit comments