Skip to content

Commit 185d1a2

Browse files
fix: Dockerfile and readme
1 parent dd00219 commit 185d1a2

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,27 +93,27 @@ Allie FlowKit Python can be run locally or as a Docker container. Follow the ins
9393
## Adding custom functions
9494

9595
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.
9898
- 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.
9999

100100
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.
103103

104104
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.
106106

107107
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.
109109

110110
### Example´
111111

112112
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`.
114114

115115
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`.
117117

118118
**custom_model.py**:
119119
```python
@@ -152,7 +152,7 @@ Allie FlowKit Python can be run locally or as a Docker container. Follow the ins
152152
**custom_endpoint.py**:
153153
```python
154154
from fastapi import FastAPI, APIRouter
155-
from app.models.custom_model import CustomRequest, CustomResponse
155+
from allie.flowkit.models.custom_model import CustomRequest, CustomResponse
156156
157157
158158
@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
176176
```
177177

178178
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.
180180

181-
**app.py**:
181+
**flowkit_service.py**:
182182
```python
183-
from app.endpoints import custom_endpoint
183+
from allie.flowkit.endpoints import custom_endpoint
184184
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(
187187
custom_endpoint.router, prefix="/custom_endpoint", tags=["custom_endpoint"]
188188
)
189189
```
190190

191191
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.
193193

194-
**app.py**:
194+
**flowkit_service.py**:
195195
```python
196196
function_map = {
197197
"split_ppt": splitter.split_ppt,

docker/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ FROM python:3.12-slim
33
WORKDIR /app
44

55
# Copy the app folder and the config.yaml file
6-
COPY app/ ./src/allie/flowkit/
7-
COPY configs/config.yaml .
6+
COPY src /app
7+
8+
# readme required by pip
9+
COPY README.md /app
10+
COPY pyproject.toml /app
11+
COPY configs/config.yaml /app
812

913
# Install dependencies
14+
RUN echo $(ls)
1015
RUN pip install --no-cache-dir .[all]
1116

1217
EXPOSE 8000

0 commit comments

Comments
 (0)