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

1/n [vscode & server] Reload Environment when invoking the Run Step #1376

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all 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
6 changes: 6 additions & 0 deletions python/src/aiconfig/editor/server/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import copy
import ctypes
import dotenv
import json
import logging
import threading
Expand Down Expand Up @@ -330,6 +331,11 @@ def run() -> FlaskResponse:
"callback_manager": True,
}
state = get_server_state(app)

# Allow user to modify their environment keys without reloading the server.
# Execution time of `0.001s` is arbitrary, but should be small enough to not be noticeable.
dotenv.load_dotenv()
Comment on lines +334 to +337
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider just adding these to model parsers directly, but this moves us forwards and we can change that later if we want


aiconfig = state.aiconfig
request_json = request.get_json()
cancellation_token_id: str | None = None
Expand Down
Loading