Skip to content
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

adding an env example file #133

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
21 changes: 21 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Bespoke Labs Curator Environment Configuration

#######################
# Required Settings
#######################

# OpenAI API Key
# Currently required as OpenAI is the only supported LLM provider
# Support for other providers (Claude, etc.) may be added in the future
# Get your key from: https://platform.openai.com/api-keys
OPENAI_API_KEY=sk-your-key-here

#######################
# Optional Settings
#######################

# Cache Directory
# Location where Curator stores its cache files
# Default: ~/.curator
# Note: This can also be set via the working_dir parameter in code
CURATOR_CACHE_DIR=
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,20 @@ nvm install 22
node -v # should print `v22.11.0`
# verifies the right npm version is in the environment
npm -v # should print `10.9.0`

```
CharlieJCJ marked this conversation as resolved.
Show resolved Hide resolved

<details>
<summary><h2 style="display: inline-block">Development</h2></summary>

### Environment Setup
Copy `.env.example` to create your `.env` file:
```bash
cp .env.example .env
```

Available environment variables:
- `OPENAI_API_KEY`: (Required) Your OpenAI API key for language model requests
- `CURATOR_CACHE_DIR`: (Optional) Custom cache directory, defaults to `~/.cache/curator`. Used to store datasets, model responses, and metadata for caching and viewer functionality.

</details>
10 changes: 5 additions & 5 deletions src/bespokelabs/curator/prompter/prompter.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ def _completions(

if self is None:
raise ValueError("Prompter must be provided")

if working_dir is None:
curator_cache_dir = os.environ.get(
"CURATOR_CACHE_DIR",
os.path.expanduser(_CURATOR_DEFAULT_CACHE_DIR),
)
# First check if CURATOR_CACHE_DIR is set and non-empty
curator_cache_dir = os.environ.get("CURATOR_CACHE_DIR", "")
if not curator_cache_dir: # If empty or not set
curator_cache_dir = os.path.expanduser(_CURATOR_DEFAULT_CACHE_DIR)
else:
curator_cache_dir = working_dir

Expand Down