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
173 stars 81 forks source link

Fix #261 issue #277

Closed huiyan2021 closed 5 days ago

huiyan2021 commented 2 weeks 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
chensuyue commented 2 weeks ago

Description

The summary of the proposed changes as long as the relevant motivation and context.

Issues

List the issue or RFC link this PR is working on. If there is no such link, please mark it as n/a.

Type of change

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

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds new functionality)
  • [ ] Breaking change (fix or feature that would break existing design and interface)

Dependencies

List the newly introduced 3rd party dependency if exists.

Tests

Describe the tests that you ran to verify your changes.

Please fill in the PR description correctly.

huiyan2021 commented 2 weeks ago

Sorry, fixed PR description.