opea-project / GenAIExamples

Generative AI Examples is a collection of GenAI examples such as ChatQnA, Copilot, which illustrate the pipeline capabilities of the Open Platform for Enterprise AI (OPEA) project.
https://opea.dev
Apache License 2.0
230 stars 148 forks source link

Fix #261 issue #325

Closed huiyan2021 closed 3 months ago

huiyan2021 commented 3 months ago

Description

os.getenv() returns a string if the environment variable has been set as shown below: MEGA_SERVICE_PORT = os.getenv("MEGA_SERVICE_PORT", 7778) which will cause TypeError: 'str' object cannot be interpreted as an integer

Issues

https://github.com/opea-project/GenAIExamples/issues/261

Type of change

List the type of change like below. Please delete options that are not relevant.

Dependencies

Tests

Set the environment "MEGA_SERVICE_PORT" when starting codegen:

  codegen-xeon-backend-server:
    image: opea/codegen:latest
    container_name: codegen-xeon-backend-server
    depends_on:
      - llm
    ports:
      - "7778:7778"
    environment:
      - https_proxy=${https_proxy}
      - http_proxy=${http_proxy}
      - MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP}
      - LLM_SERVICE_HOST_IP=${LLM_SERVICE_HOST_IP}
      - MEGA_SERVICE_PORT= 8000
    ipc: host
    restart: always