Open HavenDV opened 4 months ago
[!TIP] I can email you next time I complete a pull request if you set up your email here!
I'm sorry, but it looks like an error has occurred due to a planning failure. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://discord.gg/sweep.
For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: 3e0d1ac776
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
src/Cli/src/Commands/Auth/OpenAiCommand.cs |
Modify src/Cli/src/Commands/Auth/OpenAiCommand.cs with contents: In the OpenAiCommand constructor, add a new Option for temperature after the modelOption: ```csharp var temperatureOption = new Option<double?>( aliases: ["--temperature", "-t"], getDefaultValue: () => null, description: "The temperature to use for OpenAI requests"); AddOption(temperatureOption); ``` Then update the SetHandler call to pass temperatureOption: ```csharp this.SetHandler(HandleAsync, apiKeyArgument, modelOption, temperatureOption); ``` |
src/Cli/src/Commands/Auth/OpenAiCommand.cs |
Modify src/Cli/src/Commands/Auth/OpenAiCommand.cs with contents: Update the HandleAsync method to accept the temperature parameter: ```csharp private static async Task HandleAsync(string apiKey, string model, double? temperature) { await Helpers.AuthenticateWithApiKeyAsync(apiKey, model, Providers.OpenAi, temperature).ConfigureAwait(false); } ``` |
src/Cli/src/Helpers.cs |
Modify src/Cli/src/Helpers.cs with contents: Update the AuthenticateWithApiKeyAsync method signature to accept the temperature parameter: ```csharp public static async Task AuthenticateWithApiKeyAsync(string apiKey, string model, string provider, double? temperature) ``` |
src/Cli/src/Helpers.cs |
Modify src/Cli/src/Helpers.cs with contents: In the AuthenticateWithApiKeyAsync method, write the temperature value to a settings file after writing the model: ```csharp if (temperature.HasValue) { await File.WriteAllTextAsync(Path.Combine(settingsFolder, "temperature.txt"), temperature.Value.ToString()).ConfigureAwait(false); } ``` |
💡 To recreate the pull request edit the issue title or description.
What would you like to be added:
Why is this needed:
Anything else we need to know?
Checklist
- [X] Modify `src/Cli/src/Commands/Auth/OpenAiCommand.cs` ✓ https://github.com/tryAGI/LangChain/commit/09d364b4e0600e2cba75210cbfae321f06b13642 [Edit](https://github.com/tryAGI/LangChain/edit/sweep/add_options_like_temperature_to_langchai/src/Cli/src/Commands/Auth/OpenAiCommand.cs) - [X] Modify `src/Cli/src/Commands/Auth/OpenAiCommand.cs` ✓ https://github.com/tryAGI/LangChain/commit/09d364b4e0600e2cba75210cbfae321f06b13642 [Edit](https://github.com/tryAGI/LangChain/edit/sweep/add_options_like_temperature_to_langchai/src/Cli/src/Commands/Auth/OpenAiCommand.cs) - [X] Modify `src/Providers/OpenAI/src/OpenAiConfiguration.cs` ✓ https://github.com/tryAGI/LangChain/commit/09d364b4e0600e2cba75210cbfae321f06b13642 [Edit](https://github.com/tryAGI/LangChain/edit/sweep/add_options_like_temperature_to_langchai/src/Providers/OpenAI/src/OpenAiConfiguration.cs)