Skip to content

Allow the OpenAI URL to be configurable using an env var #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oleander
Copy link
Owner

@oleander oleander commented Feb 8, 2025

Add configurability for OpenAI URL using an environment variable and set up a fake OpenAI service in CI workflow.

  • Configurable OpenAI URL:

    • Add openai_host field to App struct in src/config.rs.
    • Set default value for openai_host in App::new method.
    • Update src/openai.rs to use openai_host from App struct.
    • Add url subcommand to config openai set in src/main.rs.
    • Implement run_config_openai_host function to handle url subcommand.
  • CI Workflow:

    • Add services section in .github/workflows/ci.yml to define a fake OpenAI service.
    • Set OPENAI_API_URL environment variable to http://localhost:8080 in the Run tests step.
    • Configure the service to expose port 8080.

Add configurability for OpenAI URL using an environment variable and set up a fake OpenAI service in CI workflow.

* **Configurable OpenAI URL:**
  - Add `openai_host` field to `App` struct in `src/config.rs`.
  - Set default value for `openai_host` in `App::new` method.
  - Update `src/openai.rs` to use `openai_host` from `App` struct.
  - Add `url` subcommand to `config openai set` in `src/main.rs`.
  - Implement `run_config_openai_host` function to handle `url` subcommand.

* **CI Workflow:**
  - Add `services` section in `.github/workflows/ci.yml` to define a fake OpenAI service.
  - Set `OPENAI_API_URL` environment variable to `http://localhost:8080` in the `Run tests` step.
  - Configure the service to expose port 8080.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant