From 26921162fd02d522b912d77abbd28e2bfb2e2170 Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 26 Jun 2024 11:41:48 +0530 Subject: [PATCH] fix tag & remove unnecessary commented out code --- .github/workflows/tag-release.yaml | 17 +++------- core/tasks/is_ready.py | 8 ----- services/backend/api_server/app/backend.py | 36 +++++++++++----------- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 28cab9a..980ba22 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -28,23 +28,16 @@ jobs: - name: Expose GH Runtime uses: crazy-max/ghaction-github-runtime@v3 - - name: set lower case owner name - run: | - echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} - env: - OWNER: "${{ github.repository_owner }}" + - name: Set lower case owner name + run: echo "OWNER_LC=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - name: Convert repository name to lowercase - run: echo "REPO_NAME_LC=$(echo ${{ github.event.repository.name }} | awk '{print tolower($0)}')" >> $GITHUB_ENV + run: echo "REPO_NAME_LC=$(echo '${{ github.event.repository.name }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - name: Build and Push Docker Images run: | - if [[ $GITHUB_REF == refs/tags/* ]]; then - TAG=${GITHUB_REF#refs/tags/} - else - TAG=${GITHUB_REF#refs/heads/} - fi - make build_and_push_images + TAG=${GITHUB_REF#refs/tags/} + make build_and_push_images TAG=$TAG SERVICE=${{ matrix.services }} env: REGISTRY: ghcr.io ORG: ${{ env.OWNER_LC }} diff --git a/core/tasks/is_ready.py b/core/tasks/is_ready.py index ae59bcf..e2b7feb 100644 --- a/core/tasks/is_ready.py +++ b/core/tasks/is_ready.py @@ -7,14 +7,6 @@ from .celery_app import app def is_ready(): - # response = requests.get(f"{litellm_url}/health", headers={ - # "Authorization": f"Bearer {os.getenv('LITELLM_MASTER_KEY', '')}" - # }) - # if not response.ok: - # raise Exception(response.text) - - # print(response) - response = requests.get(f"{litellm_url}/health/readiness") if not response.ok: raise Exception(response.text) diff --git a/services/backend/api_server/app/backend.py b/services/backend/api_server/app/backend.py index 3fdab5c..4d99321 100644 --- a/services/backend/api_server/app/backend.py +++ b/services/backend/api_server/app/backend.py @@ -196,24 +196,24 @@ async def on_startup(): welcome_asst_instruction += tool_use_instruction # Create the Welcome Assistant if it doesn't exist - # existing_assistant = await AssistantObject.find_one({"id": "asst_welcome"}) - # if not existing_assistant: - # logging.info("Creating Welcome Assistant") - # assistant = AssistantObject( - # assistant_id="asst_welcome", - # object=Object20.assistant.value, - # created_at=int(datetime.now().timestamp()), - # name="Welcome Assistant", - # description="Welcome Assistant", - # model=welcome_asst_model, - # instructions=welcome_asst_instruction, - # tools=[{"type": Type824.retrieval.value}] - # if welcome_asst_model in tool_enabled_model_pool - # else [], # browser - # file_ids=[], - # metadata={}, - # ) - # await assistant.insert() + existing_assistant = await AssistantObject.find_one({"id": "asst_welcome"}) + if not existing_assistant: + logging.info("Creating Welcome Assistant") + assistant = AssistantObject( + assistant_id="asst_welcome", + object=Object20.assistant.value, + created_at=int(datetime.now().timestamp()), + name="Welcome Assistant", + description="Welcome Assistant", + model=welcome_asst_model, + instructions=welcome_asst_instruction, + tools=[{"type": Type824.retrieval.value}] + if welcome_asst_model in tool_enabled_model_pool + else [], # browser + file_ids=[], + metadata={}, + ) + await assistant.insert() @app.get("/get_api_key_status", tags=["API Keys"])