You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a124990
Browse filesBrowse the repository at this point in the historyBrowse files
docs: add hooks, user input, and auth options to SDK READMEs (github#270)
Update all SDK documentation with new features from PRs github#237 and github#269:
- Add githubToken and useLoggedInUser client options for authentication
- Add onUserInputRequest handler for enabling ask_user tool
- Add hooks configuration for session lifecycle events
- Add User Input Requests section with examples
- Add Session Hooks section documenting all available hooks:
- onPreToolUse, onPostToolUse, onUserPromptSubmitted
- onSessionStart, onSessionEnd, onErrorOccurred
Copy file name to clipboardExpand all lines: dotnet/README.md
+116Lines changed: 116 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,8 @@ new CopilotClient(CopilotClientOptions? options = null)
68
68
-`Cwd` - Working directory for the CLI process
69
69
-`Environment` - Environment variables to pass to the CLI process
70
70
-`Logger` - `ILogger` instance for SDK logging
71
+
-`GithubToken` - GitHub token for authentication. When provided, takes priority over other auth methods.
72
+
-`UseLoggedInUser` - Whether to use logged-in user for authentication (default: true, but false when `GithubToken` is provided). Cannot be used with `CliUrl`.
71
73
72
74
#### Methods
73
75
@@ -98,6 +100,8 @@ Create a new conversation session.
98
100
-`Provider` - Custom API provider configuration (BYOK)
99
101
-`Streaming` - Enable streaming of response chunks (default: false)
100
102
-`InfiniteSessions` - Configure automatic context compaction (see below)
103
+
-`OnUserInputRequest` - Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
104
+
-`Hooks` - Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
Copy file name to clipboardExpand all lines: go/README.md
+99Lines changed: 99 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,8 @@ func main() {
96
96
-`AutoStart` (\*bool): Auto-start server on first use (default: true). Use `Bool(false)` to disable.
97
97
-`AutoRestart` (\*bool): Auto-restart on crash (default: true). Use `Bool(false)` to disable.
98
98
-`Env` ([]string): Environment variables for CLI process (default: inherits from current process)
99
+
-`GithubToken` (string): GitHub token for authentication. When provided, takes priority over other auth methods.
100
+
-`UseLoggedInUser` (\*bool): Whether to use logged-in user for authentication (default: true, but false when `GithubToken` is provided). Cannot be used with `CLIUrl`.
99
101
100
102
**SessionConfig:**
101
103
@@ -106,6 +108,8 @@ func main() {
106
108
-`Provider` (\*ProviderConfig): Custom API provider configuration (BYOK). See [Custom Providers](#custom-providers) section.
-`OnUserInputRequest` (UserInputHandler): Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
112
+
-`Hooks` (\*SessionHooks): Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `Type: "azure"`, not `Type: "openai"`.
398
402
> - The `BaseURL` should be just the host (e.g., `https://my-resource.openai.azure.com`). Do **not** include `/openai/v1` in the URL - the SDK handles path construction automatically.
399
403
404
+
## User Input Requests
405
+
406
+
Enable the agent to ask questions to the user using the `ask_user` tool by providing an `OnUserInputRequest` handler:
-`autoStart?: boolean` - Auto-start server (default: true)
66
66
-`autoRestart?: boolean` - Auto-restart on crash (default: true)
67
+
-`githubToken?: string` - GitHub token for authentication. When provided, takes priority over other auth methods.
68
+
-`useLoggedInUser?: boolean` - Whether to use logged-in user for authentication (default: true, but false when `githubToken` is provided). Cannot be used with `cliUrl`.
67
69
68
70
#### Methods
69
71
@@ -91,6 +93,8 @@ Create a new conversation session.
91
93
-`systemMessage?: SystemMessageConfig` - System message customization (see below)
92
94
-`infiniteSessions?: InfiniteSessionConfig` - Configure automatic context compaction (see below)
93
95
-`provider?: ProviderConfig` - Custom API provider configuration (BYOK - Bring Your Own Key). See [Custom Providers](#custom-providers) section.
96
+
-`onUserInputRequest?: UserInputHandler` - Handler for user input requests from the agent. Enables the `ask_user` tool. See [User Input Requests](#user-input-requests) section.
97
+
-`hooks?: SessionHooks` - Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `type: "azure"`, not `type: "openai"`.
471
475
> - The `baseUrl` should be just the host (e.g., `https://my-resource.openai.azure.com`). Do **not** include `/openai/v1` in the URL - the SDK handles path construction automatically.
472
476
477
+
## User Input Requests
478
+
479
+
Enable the agent to ask questions to the user using the `ask_user` tool by providing an `onUserInputRequest` handler:
0 commit comments