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

Allow Github Copilot to be used with Terminal Chat #18014

Merged
merged 106 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
b44216b
got an idl
PankajBhojwani Jun 6, 2024
e78e4d0
works
PankajBhojwani Jun 7, 2024
ac83d76
allow
PankajBhojwani Jun 7, 2024
4b944e9
conflict
PankajBhojwani Jun 7, 2024
ef406ee
use id here too
PankajBhojwani Jun 7, 2024
4fb4ca4
have terminal page initialize the llmprovider
PankajBhojwani Jun 7, 2024
e5afbae
format
PankajBhojwani Jun 7, 2024
32b3d68
consts
PankajBhojwani Jun 8, 2024
1700a92
works on palette side
PankajBhojwani Jun 11, 2024
08dd951
open ai in settings, llmprovider enum
PankajBhojwani Jun 13, 2024
1934b30
aiconfig struct
PankajBhojwani Jun 20, 2024
96a489a
move more things to ai info
PankajBhojwani Jun 21, 2024
6052a8d
works on palette side
PankajBhojwani Jun 11, 2024
4add2c9
open ai in settings, llmprovider enum
PankajBhojwani Jun 13, 2024
c3885ff
aiconfig struct
PankajBhojwani Jun 20, 2024
646c28b
move more things to ai info
PankajBhojwani Jun 21, 2024
fb7ff3c
github copilot impl works
PankajBhojwani Jun 28, 2024
8bf23bc
handle uri action
PankajBhojwani Jul 2, 2024
65c2587
rough edges, but roundtrip works
PankajBhojwani Jul 4, 2024
73eb2af
mark a couple todos
PankajBhojwani Jul 8, 2024
8e560e2
active provider buttons
PankajBhojwani Jul 9, 2024
f9e9326
rename to lmprovider
PankajBhojwani Jul 9, 2024
4133239
spelling conflict
PankajBhojwani Jul 9, 2024
e545ca2
conflicts
PankajBhojwani Jul 9, 2024
dfad8d9
spell
PankajBhojwani Jul 9, 2024
5139b88
array of accepted models
PankajBhojwani Jul 9, 2024
dfbdc75
cleanup this comment
PankajBhojwani Jul 9, 2024
2819606
placeholder, remove device flow code
PankajBhojwani Jul 11, 2024
19e73db
refresh tokens works
PankajBhojwani Jul 11, 2024
82125f9
error dialog for failed auth
PankajBhojwani Jul 11, 2024
405276e
mark todos
PankajBhojwani Jul 12, 2024
1f305ab
first round of comments
PankajBhojwani Jul 15, 2024
242b964
combine setter/getter
PankajBhojwani Jul 15, 2024
0094db0
Merge branch 'dev/pabhoj/llm_provider_interface' of https://github.co…
PankajBhojwani Jul 15, 2024
3560339
conflicts
PankajBhojwani Jul 15, 2024
86f4966
active button and bool
PankajBhojwani Jul 15, 2024
6479c47
auth related functions
PankajBhojwani Jul 16, 2024
2cfe23d
github auth function implementation, static event on settings side
PankajBhojwani Jul 16, 2024
eb1c805
nope just wrong thread
PankajBhojwani Jul 16, 2024
d392aab
dispatcher
PankajBhojwani Jul 17, 2024
8faf8b4
domain check
PankajBhojwani Jul 17, 2024
dd6b46d
hot reload works now
PankajBhojwani Jul 18, 2024
4f81775
conflict and updates to openAI provider
PankajBhojwani Jul 18, 2024
46ab508
password box
PankajBhojwani Jul 18, 2024
ac1b4a3
logic for updating providers based on settings changes
PankajBhojwani Jul 18, 2024
90642d0
conflict, updates with new interface
PankajBhojwani Jul 19, 2024
fc8e36d
use static strings for strings used more than once
PankajBhojwani Jul 19, 2024
e8fc46d
conflict, updates with new interface
PankajBhojwani Jul 19, 2024
6ef93f4
Merge branch 'dev/pabhoj/featurellm_capi' of https://microsoft.visual…
PankajBhojwani Jul 19, 2024
cddbd75
random state string, manifest for canary
PankajBhojwani Jul 19, 2024
fdee6c2
Merge branch 'feature/llm' of https://github.com/microsoft/terminal i…
PankajBhojwani Jul 19, 2024
fff97a4
merge
PankajBhojwani Jul 20, 2024
4cd6e82
merge
PankajBhojwani Jul 20, 2024
c86dfdd
auth values
PankajBhojwani Jul 22, 2024
45ce94d
don't use &
PankajBhojwani Jul 22, 2024
c89a306
update with base changes
PankajBhojwani Jul 22, 2024
63d6c63
update
PankajBhojwani Jul 22, 2024
de88842
conflict
PankajBhojwani Sep 9, 2024
edf08a9
missed this
PankajBhojwani Sep 9, 2024
830e655
newline...
PankajBhojwani Sep 9, 2024
ef9fb02
conflict
PankajBhojwani Sep 9, 2024
2adbe0e
update settings ui
PankajBhojwani Sep 9, 2024
c094900
use correct links
PankajBhojwani Sep 9, 2024
15f9d8e
checkbox
PankajBhojwani Sep 10, 2024
234ebd0
allow LMProviders to modify parts of the UI, github copilot provider …
PankajBhojwani Sep 11, 2024
1cd7f33
username metadata
PankajBhojwani Sep 11, 2024
ec294e5
GitHub
PankajBhojwani Sep 11, 2024
c1e74c9
sequencing
PankajBhojwani Sep 13, 2024
14949c1
branding data struct
PankajBhojwani Oct 8, 2024
32caeba
github telemetry
PankajBhojwani Oct 8, 2024
c504a08
why was this here
PankajBhojwani Oct 8, 2024
a70339c
launch setting issue
PankajBhojwani Oct 8, 2024
bfb4295
H in github
PankajBhojwani Oct 10, 2024
6fa4cc7
feature flag for capi
PankajBhojwani Oct 11, 2024
93f065f
add feature id
PankajBhojwani Oct 11, 2024
5665097
display error message on failed auth
PankajBhojwani Oct 15, 2024
ad5dba5
comments
PankajBhojwani Oct 15, 2024
5931ecd
better refresh
PankajBhojwani Oct 15, 2024
b376da4
api spell
PankajBhojwani Oct 15, 2024
ba81e16
sku isolation
PankajBhojwani Oct 16, 2024
d0a9e05
deduplicate a bunch
PankajBhojwani Oct 16, 2024
5ea6f62
move secret to its own file
PankajBhojwani Oct 17, 2024
16d3035
conflict
PankajBhojwani Oct 17, 2024
8dc2dfb
conflict
PankajBhojwani Oct 17, 2024
e973ced
open ai desc fixes
PankajBhojwani Oct 17, 2024
ea79fb9
caching logic and other comments
PankajBhojwani Oct 22, 2024
9031427
std move
PankajBhojwani Oct 22, 2024
3ee948d
comment
PankajBhojwani Oct 22, 2024
b2e38af
nits
PankajBhojwani Oct 23, 2024
ce4a1de
zwstring_view
PankajBhojwani Oct 23, 2024
95e721c
conflict
PankajBhojwani Oct 23, 2024
596d17e
store the last response to bubble in case of errors
PankajBhojwani Oct 23, 2024
2fc21ef
rename to attribution, getters only
PankajBhojwani Oct 24, 2024
bcfc1d4
branding too
PankajBhojwani Oct 24, 2024
2bb6d7f
some fixes
PankajBhojwani Oct 24, 2024
6a694ae
auth values as string
PankajBhojwani Oct 24, 2024
3ffaafc
use winrt::hstring
PankajBhojwani Oct 24, 2024
d0847a1
wait these didn't save
PankajBhojwani Oct 24, 2024
7234b9d
strong
PankajBhojwani Oct 24, 2024
b969baf
safer coroutines
PankajBhojwani Oct 24, 2024
e0d7172
turn on feature for new build
PankajBhojwani Oct 25, 2024
bd34e90
iasyncaction instead
PankajBhojwani Oct 25, 2024
df9a233
use a grid because stackpanel is the worst
PankajBhojwani Oct 25, 2024
a6deddf
Merge branch 'feature/llm' of https://github.com/microsoft/terminal i…
PankajBhojwani Oct 28, 2024
0564bc5
conflict
PankajBhojwani Oct 28, 2024
9a30666
unpackaged check
PankajBhojwani Oct 28, 2024
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
4 changes: 2 additions & 2 deletions src/cascadia/QueryExtension/GithubCopilotLLMProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace winrt::Microsoft::Terminal::Query::Extension::implementation
Windows::Data::Json::JsonObject authValuesJson;
authValuesJson.SetNamedValue(accessTokenKey, WDJ::JsonValue::CreateStringValue(_authToken));
authValuesJson.SetNamedValue(refreshTokenKey, WDJ::JsonValue::CreateStringValue(_refreshToken));
_AuthChangedHandlers(*this, winrt::make<GithubCopilotAuthenticationResult>(L"", authValuesJson.ToString()));
_AuthChangedHandlers(*this, winrt::make<GithubCopilotAuthenticationResult>(winrt::hstring{}, authValuesJson.ToString()));

// we also need to get the correct endpoint to use and the username
_obtainUsernameAndRefreshTokensIfNeeded();
Expand Down Expand Up @@ -342,7 +342,7 @@ namespace winrt::Microsoft::Terminal::Query::Extension::implementation
Windows::Data::Json::JsonObject authValuesJson;
authValuesJson.SetNamedValue(accessTokenKey, WDJ::JsonValue::CreateStringValue(_authToken));
authValuesJson.SetNamedValue(refreshTokenKey, WDJ::JsonValue::CreateStringValue(_refreshToken));
_AuthChangedHandlers(*this, winrt::make<GithubCopilotAuthenticationResult>(L"", authValuesJson.ToString()));
_AuthChangedHandlers(*this, winrt::make<GithubCopilotAuthenticationResult>(winrt::hstring{}, authValuesJson.ToString()));
}
CATCH_LOG();
}
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/QueryExtension/OpenAILLMProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ namespace winrt::Microsoft::Terminal::Query::Extension::implementation
responseMessageObject.Insert(L"content", WDJ::JsonValue::CreateStringValue(message));
_jsonMessages.Append(responseMessageObject);

co_return winrt::make<OpenAIResponse>(message, errorType, L"");
co_return winrt::make<OpenAIResponse>(message, errorType, winrt::hstring{});
}
}
14 changes: 7 additions & 7 deletions src/cascadia/TerminalSettingsEditor/AISettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

void AISettings::ClearAzureOpenAIKeyAndEndpoint_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
{
_ViewModel.AzureOpenAIEndpoint(L"");
_ViewModel.AzureOpenAIKey(L"");
_ViewModel.AzureOpenAIEndpoint(winrt::hstring{});
_ViewModel.AzureOpenAIKey(winrt::hstring{});
}

void AISettings::StoreAzureOpenAIKeyAndEndpoint_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
Expand All @@ -98,8 +98,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
_ViewModel.AzureOpenAIEndpoint(AzureOpenAIEndpointInputBox().Text());
_ViewModel.AzureOpenAIKey(AzureOpenAIKeyInputBox().Password());
AzureOpenAIEndpointInputBox().Text(L"");
AzureOpenAIKeyInputBox().Password(L"");
AzureOpenAIEndpointInputBox().Text(winrt::hstring{});
AzureOpenAIKeyInputBox().Password(winrt::hstring{});

TraceLoggingWrite(
g_hSettingsEditorProvider,
Expand All @@ -112,7 +112,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

void AISettings::ClearOpenAIKey_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
{
_ViewModel.OpenAIKey(L"");
_ViewModel.OpenAIKey(winrt::hstring{});
}

void AISettings::StoreOpenAIKey_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
Expand All @@ -121,7 +121,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
if (!password.empty())
{
_ViewModel.OpenAIKey(password);
OpenAIKeyInputBox().Password(L"");
OpenAIKeyInputBox().Password(winrt::hstring{});

TraceLoggingWrite(
g_hSettingsEditorProvider,
Expand All @@ -134,7 +134,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation

void AISettings::ClearGithubCopilotTokens_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
{
_ViewModel.GithubCopilotAuthValues(L"");
_ViewModel.GithubCopilotAuthValues(winrt::hstring{});
}

void AISettings::SetAzureOpenAIActive_Check(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/)
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalSettingsModel/AIConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ winrt::hstring AIConfig::_RetrieveCredential(const wil::zwstring_view credential
}
catch (...)
{
return L"";
return winrt::hstring{};
PankajBhojwani marked this conversation as resolved.
Show resolved Hide resolved
}

winrt::hstring password{ cred.Password() };
Expand Down
Loading