Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions fas_llm_applications/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.9-slim-bullseye AS base

RUN set -x

RUN apt-get update \
&& apt-get -y install curl \
&& apt-get -y install net-tools \
&& apt-get -y install procps \
&& apt-get -y install build-essential \
&& apt-get -y install docker.io

# Install notebook depenency
RUN pip install ipython ipykernel
RUN ipython kernel install --user --name promptflow

# FROM base AS fas_llm_applications
COPY requirements.txt .
RUN pip install -r requirements.txt

RUN set +x

CMD bash
13 changes: 13 additions & 0 deletions fas_llm_applications/.devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Devcontainer for promptflow
To facilitate your promptflow project development and empower you to work on LLM projects using promptflow more effectively,
we've configured the necessary environment for developing promptflow projects and utilizing flows through the dev container feature.
You can seamlessly initiate your promptflow project development and start leveraging flows by simply using the dev container feature via VS Code or Codespaces.

## Use Github Codespaces
Use codespaces to open promptflow repo, it will automatically build the dev containers environment and open promptflow with dev containers. You can just click: [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/promptflow?quickstart=1)

## Use local devcontainer
Use vscode to open promptflow repo, and install vscode extension: Dev Containers and then open promptflow with dev containers.
![devcontainer](./devcontainers.png)
**About dev containers please refer to: [dev containers](https://code.visualstudio.com/docs/devcontainers/containers)**

40 changes: 40 additions & 0 deletions fas_llm_applications/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Promptflow-FAS_LLM_Applications-Python39",
"context": ".",
"dockerFile": "Dockerfile",
"runArgs": [
"-v",
"/var/run/docker.sock:/var/run/docker.sock"
],
"postStartCommand": "/bin/bash -c 'set -e; eval \"$(python digital_latin_project/scripts/load_env_to_shell.py)\" && PYTHON_ENV_SOURCE_CMD=\"eval \\\"\\$(python digital_latin_project/scripts/load_env_to_shell.py)\\\"\" && grep -qF \"${PYTHON_ENV_SOURCE_CMD}\" ~/.bashrc || echo \"${PYTHON_ENV_SOURCE_CMD}\" >> ~/.bashrc && python _connections_manager_/setup_all_shared_connections.py'",
"postCreateCommand": "pip install -r requirements.txt",
"remoteEnv": {
"HOST_PROJECT_PATH": "${localWorkspaceFolder}",
"PYTHONPATH": "/workspaces/promptflow:${containerEnv:PYTHONPATH}"
},
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
"examples/README.md"
]
},
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "${containerWorkspaceFolder}/.venv/bin/python",
"python.terminal.activateEnvironment": true // Automatically activate venv in terminal
},
"extensions": [
"ms-python.python",
"ms-toolsai.vscode-ai",
"ms-toolsai.jupyter",
"redhat.vscode-yaml",
"prompt-flow.prompt-flow"
]
}
},
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {}
}
}
40 changes: 40 additions & 0 deletions fas_llm_applications/.devcontainer/devcontainer.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Promptflow-Python39",
"context": ".",
"dockerFile": "Dockerfile",
"runArgs": [
"-v",
"/var/run/docker.sock:/var/run/docker.sock"
],
"postStartCommand": "/bin/bash -c 'set -e; rm -f ~/.promptflow/pf.sqlite && eval \"$(python ../scripts/load_env_to_shell.py)\" && PYTHON_ENV_SOURCE_CMD=\"eval \\\"\\$(python ../scripts/load_env_to_shell.py)\\\"\" && grep -qF \"${PYTHON_ENV_SOURCE_CMD}\" ~/.bashrc || echo \"${PYTHON_ENV_SOURCE_CMD}\" >> ~/.bashrc && python fas_llm_applications/_connections_manager_/setup_all_shared_connections.py'",
"postCreateCommand": "pip install -r fas_llm_applications/digital_latin_project/requirements.txt",
"remoteEnv": {
"HOST_PROJECT_PATH": "${localWorkspaceFolder}",
"PYTHONPATH": "/workspaces/promptflow:${containerEnv:PYTHONPATH}"
},
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
"examples/README.md"
]
},
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"ms-python.python",
"ms-toolsai.vscode-ai",
"ms-toolsai.jupyter",
"redhat.vscode-yaml",
"prompt-flow.prompt-flow"
]
}
},
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
// "containerEnv": {} Locally, .env file can be added here.
// In Github Codespaces, leave this commented out or removed as secure env variables will be loaded from .env file or Github Secure variables
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions fas_llm_applications/.devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This would be used if you're setting up the environment for the entire solution.
promptflow[azure]>=1.9.0
promptflow-tools
24 changes: 24 additions & 0 deletions fas_llm_applications/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .env file for local environment variables (contains sensitive data)
.env

# Python bytecode (auto-generated, not meant for version control)
__pycache__/
*.pyc

# PromptFlow's internal metadata/cache for flows
# These are generated by the PromptFlow UI/CLI and generally not relevant for committing,
# except for flow.tools.json which is needed for Azure ML component integration.
# The main PromptFlow project also ignores these files, with the same exception.
digital_latin_project/flows/**/.promptflow/
# Re-include flow.tools.json as it's often required for Azure ML integration
!digital_latin_project/flows/**/.promptflow/flow.tools.json

# NOTE: We are *intentionally* not ignoring .log or .txt files anywhere,
# and are explicitly including all contents of 'results/' and 'prepared_reports/'
# for now, as we are still in the process of understanding PromptFlow behavior
# and using the repo as a temporary data store for outputs.
# If these folders or file types were to be ignored later, specific rules would be added here.

# Example: If we later decide to ignore *all* JSON results, but still keep logs and reports:
# digital_latin_project/results/*.json
# digital_latin_project/prepared_reports/*.json
Loading