Skip to content

Assist - Configuration and usage#25953

Merged
jakule merged 5 commits intomasterfrom
jakule/ai-config-port
May 11, 2023
Merged

Assist - Configuration and usage#25953
jakule merged 5 commits intomasterfrom
jakule/ai-config-port

Conversation

@jakule
Copy link
Copy Markdown
Contributor

@jakule jakule commented May 9, 2023

This PR contains Teleport Assist configuration changes - YAML files, Cloud config, and prehog.

Note: YAML configuration will be removed once plugin supports is available in Teleport OSS.

@jakule jakule force-pushed the jakule/ai-config-port branch from 06bb21d to 74d9701 Compare May 10, 2023 06:38
@jakule jakule marked this pull request as ready for review May 10, 2023 06:58
@jakule jakule requested review from r0mant and zmb3 May 10, 2023 07:01
Comment thread lib/service/proxy_settings.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this need to be exported?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread lib/config/configuration.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return trace.Errorf("failed to read OpenAI API key file: %w", err)
return trace.ConvertSystemError("failed to read OpenAI API key file at path %v: %w", keyPath, err)

Comment thread lib/config/fileconf.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
OpenAI *OpenAIOptions `yaml:"openai,omitempty"`
// OpenAI is ...
OpenAI *OpenAIOptions `yaml:"openai,omitempty"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

Comment thread lib/config/fileconf.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
//APITokenPath is the path to a file with OpenAI API key.
// APITokenPath is the path to a file with OpenAI API key.

@jakule jakule added this pull request to the merge queue May 10, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2023
@jakule jakule added this pull request to the merge queue May 10, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2023
@jakule jakule added this pull request to the merge queue May 10, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 10, 2023
@jakule jakule force-pushed the jakule/ai-config-port branch from d35ed6e to 52a35e7 Compare May 11, 2023 01:41
@jakule jakule enabled auto-merge May 11, 2023 01:43
@jakule jakule added this pull request to the merge queue May 11, 2023
Merged via the queue into master with commit ae8f2fa May 11, 2023
@jakule jakule deleted the jakule/ai-config-port branch May 11, 2023 02:13
jakule added a commit that referenced this pull request May 11, 2023
* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments
jakule added a commit that referenced this pull request May 11, 2023
* Assist - Configuration and usage (#25953)

* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments

* Fix imports
mdwn pushed a commit that referenced this pull request May 17, 2023
* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments
jakule added a commit that referenced this pull request Jun 2, 2023
* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments
jakule added a commit that referenced this pull request Jun 3, 2023
* Assist - API implementation (#25810)

* Assist - API implementation

* Add Assistant CRUD test

* Move assistant API to a separate file.

* Rename GRPC methods
Fix comments

* Address PR comments

* Update GRPC API - addressing code review comments

* Move assist API to a new GRPC service

* Add Assistant RBAC rules to this backport.

* Add missing license

* Update comment.

* Move username and ID out of AssistantMessage (#25964)

* Move username and ID out of AssistantMessage

#25810 added username and conversation ID to AssistantMessage. They aren't needed inside the message and can be moved out of it.
This PR also fixes ` grpc: error while marshaling: proto: Marshal called with nil` in `CreateAssistantMessage`.

Note: It's safe to change protobuf numbers as this code hasn't been released or backported yet.

* Fix test

* make grpc

* Assist - Configuration and usage (#25953)

* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments

* Assist - OpenAI library port (#25948)

* Assist - OpenAI library port

* Add tests

* Address code review comments

* Added comment

* Partial backport of #26058

* Move AI messages to a new file

* Prevent blocking on error

* Add comments.
Fix typo

* Assist - Execution web endpoint (#25955)

* Assist - Execution web endpoint

* Add test
Clean up code a bit

* Add missing username

* Address review comments

* Make more implementation shared between Terminal and Command Web Handlers

* Address review comments

* Address review comments

* Fixes after rebase
Add comments

* Add comments
Fix linter

* Add TELEPORT to Teleport related environment variable.

* Assist - Web endpoints (#26046)

* Assist - Web endpoints

* GCI

* proto rpc

* enforce endpoint checks

* disable in ui if disallowed by auth

* add comment

* unwrap stack

* Refactor code

---------

Co-authored-by: Joel Wejdenstål <jwejdenstal@icloud.com>

* [Assist] Fix random user selection (#26183)

Currently, after selecting a user for command execution in Teleport Assist the user can randomly change. This PR fixes this behavior.

* Add rate limiting to Assist (#26011)

* Add rate limiting to Assist

* Only rate limit Assist in Cloud

* Add a comment to assistantLimiter

* Fixes after rebase

* Add 'rate-limited' test case to assistant_test

* Handle CHAT_MESSAGE_UI in Assist web UI

* Add godoc

* CHAT_MESSAGE_UI -> CHAT_MESSAGE_ERROR

* Run assistant test cases in parallel

* Rename `ChatGPT` to `GPT-4` (#26272)

* Rename `ChatGPT` to `GPT4`

ChatGPT is a user friendly name, but is technically inaccurate.

* Apply suggestions from code review

Co-authored-by: Reed Loden <reed@goteleport.com>

* Lint fix

* Additional ChatGPT --> OpenAI GPT-4 fixes

---------

Co-authored-by: Reed Loden <reed@goteleport.com>

* Fix Assist rate-limiting in Cloud (#26342)

When Proxy is separate from Auth,
Proxy 'modules' will not contain meaningful data.
Instead, one must use ClusterFeatures fetched from the Auth server

* Assist UI improvements (#26365)

* Update assist warning wording, add link to ToS (#26396)

* Always render the portal for the assist title to go into (#26733)

* Stop using TokenPath for API key in Assist (#26671)

* [Assist] MFA support (#26719)

* Initial support for MFA in Assist

* UI webauth handler

* WebUI - WIP

* Run prettier

* Perform MFA ceremony only once.

* Cleanup JS

* Remove hacky WS logic

* Add cancel MFA logic

* [Assist] Prevent creating messages without conversation (#26797)

* Add parallel execution to assist. (#26563)

* Add parallel execution to assist.

* Extract execution logic to a new function.

* Add test

* Switch uber to std

* Address code review comments

* Fix display of Assist command executions with empty output (#27010)

* Fix display of Assist executions with empty output

* Lint

* Nit

* Improve display of commands that failed with code

* Address lint

* [Assist] Allow removing assist conversations (#26788)

* [Assist] Allow removing assist conversations

* Display landing page after the conversion is removed

* Improve styling and add a confirmation dialog

* Change the icon opacity to copy the main navigation

* Remove unused minus icon

* Add missing trace.wrap

---------

Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>

* Backport fixes

* Regenerate go.sum to make the linter happy.

* Sync files after rebase

* After rebase fixes

---------

Co-authored-by: Joel Wejdenstål <jwejdenstal@icloud.com>
Co-authored-by: Justinas Stankevičius <justinas@users.noreply.github.com>
Co-authored-by: Mike Jensen <jentfoo@users.noreply.github.com>
Co-authored-by: Reed Loden <reed@goteleport.com>
Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants