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

vscode + github models #607

Merged
merged 3 commits into from
Aug 7, 2024
Merged

vscode + github models #607

merged 3 commits into from
Aug 7, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Aug 7, 2024

Lookup configuration from env to support github models from vscode

  • The core has a new LanguageModelConfigurationRequest that's handled on the server side. It fetches configuration details for a specific language model. This information can be accessed through a new function in the WebSocketClient class. 💯
  • Developers cannot forget to define a token for GitHub models anymore. They will be reminded by an error message if they do. ⚠️
  • If a .env file exists in the workspace, it no longer determines the default model and tokens for language models. These are fetched on request and when initializing the client. ♻️
  • Model defaults changed. "openai:gpt-4" is not the default model anymore but rather "openai:gpt-4o". The array of default alternative models has been updated accordingly. ↩️
  • Several GitHub-related changes were applied. The function readSecret was moved from Host to RuntimeHost and is used slightly differently. It seems to read secrets from the environment or possibly the .env file. 🔒
  • host was renamed to runtimeHost in a few places. Like its name suggests, runtimeHost has additional capabilities over host related to the runtime environment. 🏃‍♂️
  • Lastly, handling of the .gitignore file in the function readFiles was improved. Files are now filtered based on it, resulting in a more accurate behavior. 📂

generated by pr-describe

Copy link

github-actions bot commented Aug 7, 2024

The changes in the GIT_DIFF mostly involve refactoring, improvements and addition of new functionalities.

  1. The host instance is renamed to runtimeHost in several files - Probably for better readability and understanding.
  2. The DEFAULT_MODEL constant is changed to "openai:gpt-4o".
  3. The readSecret function is removed from Host and added to RuntimeHost, which is a more appropriate place for it.
  4. A new case for handling "model.configuration" messages is added in the switch statement of the startServer function in server.ts. This allows the server to handle requests for getting language model configuration.
  5. Error handling is added in parseTokenFromEnv function in connection.ts file, which throws an error when the GITHUB_MODELS_TOKEN or GITHUB_TOKEN is not set.
  6. getLanguageModelConfiguration function is added in the WebSocketClient class, which queues a LanguageModelConfigurationRequest and returns the configuration information of the language model with the given modelId.
  7. Corresponding request and response interfaces for the LanguageModelConfigurationRequest have been added in messages.ts.

Overall, the changes look good. However, without seeing the entire codebase and understanding the complete context, it's not possible to identify any potential functional issues. It's also important to ensure that the changes are covered by tests to avoid any regressions.

LGTM 🚀

generated by pr-review

@pelikhan pelikhan merged commit 4636f8d into main Aug 7, 2024
10 checks passed
@pelikhan pelikhan deleted the serverconfig branch August 7, 2024 14:59
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