Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/python_prepare/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e
with:
python-version: 3.10.14
- name: Install Poetry
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python_cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ jobs:
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages.
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages.
# Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image.
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image.
# The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
submodules: true
- uses: ./.github/actions/python_prepare
Expand All @@ -20,7 +20,7 @@ jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
with:
submodules: true
- uses: ./.github/actions/python_prepare
Expand All @@ -30,11 +30,11 @@ jobs:
pytest-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Extract environment variables for Docker container
# No variables required right now, add them here if needed.
run: |
echo "" >> .env
echo "" >> .env
- name: Build Dockerimage
run: make build
- name: Run pytest in Docker
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
Expand All @@ -53,15 +53,15 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: ./.github/actions/python_prepare
- name: Check with black
run: poetry run black --check .

autoflake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: ./.github/actions/python_prepare
- name: Check with autoflake
run: |
Expand All @@ -71,7 +71,7 @@ jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: ./.github/actions/python_prepare
- name: Check with isort
run: |
Expand All @@ -85,7 +85,7 @@ jobs:
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Cleanup old GHCR images
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Security Gate

on:
pull_request:

jobs:
pip-audit:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- uses: ./.github/actions/python_prepare
- name: Extract requirements from Poetry
run: poetry run pip freeze > requirements.txt
- uses: pypa/gh-action-pip-audit@1d2d6f2a660b0c6aa7f74ddc7fa05e1e07ea172f
with:
inputs: requirements.txt
ignore-vulns: |
CVE-2026-25580

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Checkout private action
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
repository: gnosis/github-security-action
token: ${{ secrets.GSA_GH_TOKEN }}
path: .github/actions/github-security-action
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!/test*

- name: Run security action
uses: ./.github/actions/github-security-action
with:
ai_api_key: ${{ secrets.GSA_AI_API_KEY }}
gh_token: ${{ secrets.GSA_GH_TOKEN }}
4 changes: 4 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default code owners for all files

* @kongzii
* @TS9001
4 changes: 2 additions & 2 deletions labs_api/insights/insights.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def tavily_response_to_summary(question: str, tavily_response: TavilyResponse) -
contents = [result.content for result in tavily_response.results]

llm = ChatOpenAI(
model="gpt-4o-2024-08-06",
model_name="gpt-4o-2024-08-06",
temperature=LLM_SUPER_LOW_TEMPERATURE,
api_key=APIKeys().openai_api_key_secretstr_v1,
openai_api_key=APIKeys().openai_api_key,
)

prompt = ChatPromptTemplate.from_template(
Expand Down
Loading
Loading