Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-go
/ functions
Functions
17,396 in github.com/anthropics/anthropic-sdk-go
⨍
Functions
17,396
◇
Types & classes
5,294
↓ 11 callers
Method
Dispose
()
lib/environments/memories.go:187
↓ 11 callers
Method
ExtraFields
ExtraFields returns the extra fields added to the JSON object.
packages/param/param.go:134
↓ 11 callers
Function
Guard
Guard runs record, with which an SDK method records telemetry of its own, and hands a panic in it to [HandleRecovered], so that the API call goes on a
internal/tracing/tracing.go:198
↓ 11 callers
Method
HashTree
(under string)
lib/environments/memories.go:182
↓ 11 callers
Function
NewClient
NewClient creates a new AWS gateway client with the given configuration. Any additional [option.RequestOption] values are applied after the client's
aws/aws.go:100
↓ 11 callers
Method
SetIndex
SetIndex pins the fallback at zero-based index i. Negative resets to the original params; a pin past the configured chain errors when used.
lib/betafallback/betafallback.go:44
↓ 11 callers
Method
StreamEvents
Stream Events
betasessionevent.go:116
↓ 11 callers
Function
WithSpanContentQuery
WithSpanContentQuery returns a RequestOption that lists the query parameters whose value is content on this endpoint only. The method passes it next t
internal/requestconfig/otel.go:99
↓ 11 callers
Method
betas
betas returns the tokens of the anthropic-beta header, sorted.
betamessagethreadutil_test.go:53
↓ 11 callers
Function
evenly
evenly exists because SampledFrom favors the first options.
betasessiontoolrunner_properties_test.go:28
↓ 11 callers
Method
event
(eventType string, fields event)
betasessiontoolrunner_fake_test.go:1037
↓ 11 callers
Method
failForApplied
(client, kind string, status, times int, applied bool)
environmentworker_fake_test.go:354
↓ 11 callers
Function
failing
(kind string, status int)
environmentworker_properties_test.go:415
↓ 11 callers
Function
fetchSession
fetchSession retrieves the fake server's session. Download takes that snapshot and never looks the session up itself, so every test fetches it the way
lib/environments/memories_test.go:452
↓ 11 callers
Method
interruptThread
The log shows no interrupt that names a subagent.
betasessiontoolrunner_fake_test.go:702
↓ 11 callers
Function
newTestClient
(t *testing.T, server *httptest.Server, cfg ClientConfig, opts ...option.RequestOption)
foundry/foundry_test.go:58
↓ 11 callers
Function
newTestMantleClient
newTestMantleClient creates a MantleClient pointed at a test server and returns the client and a struct that captures the request headers/URL.
bedrock/bedrockmantle_test.go:70
↓ 11 callers
Function
plainError
plainError is an error response without details.
betamessagethreadutil_test.go:309
↓ 11 callers
Function
recordRequests
recordRequests answers every request in place of the network and records what was asked for, so a derived gateway URL can be asserted on.
googlecloud/googlecloud_test.go:384
↓ 11 callers
Function
refusedReply
refusedReply is a reply that stopped with refusal.
betamessagethreadutil_test.go:239
↓ 11 callers
Method
requests
()
internal/auth/integration_test.go:1335
↓ 11 callers
Function
requireRefused
(t *testing.T, err error)
internal/filestore/filestore_test.go:60
↓ 11 callers
Function
resolvePath
resolvePath resolves p against env.Workdir and rejects results outside the permitted roots: Workdir plus each non-empty entry of env.AllowedRoots. Abs
tools/agenttoolset/agenttoolset.go:260
↓ 11 callers
Method
sendMessage
sendMessage sends a message that is listed as pending until a turn starts, which may never happen.
betasessiontoolrunner_fake_test.go:673
↓ 11 callers
Function
sendTestMantleRequest
(t *testing.T, client *MantleClient)
bedrock/bedrockmantle_test.go:84
↓ 11 callers
Function
spansNamed
(recorder *spanRecorder, name string)
betasessiontoolrunner_test.go:2104
↓ 11 callers
Function
wantTruncated
wantTruncated fails the test unless truncated is true when want, and absent otherwise.
internal/telemetry/content_test.go:85
↓ 10 callers
Method
Cleanup
Cleanup is the teardown, run once the session's tools are closed: the last full sync when the session ended cleanly, a flush of unsynced writes always
lib/environments/memories.go:578
↓ 10 callers
Method
Error
()
internal/apierror/apierror.go:76
↓ 10 callers
Method
FilesSnapshot
()
lib/environments/memories_test.go:166
↓ 10 callers
Method
IsCompleted
IsCompleted returns true if the conversation has finished, either because the model stopped using tools or the maximum iteration limit was reached.
betatoolrunner.go:337
↓ 10 callers
Method
ListAutoPaging
List Files When the returned error is an [*apierror.Error], compare the [apierror.Error.ErrorCode] against these values. - [ErrorCodeClaudeCodeKeyCr
file.go:84
↓ 10 callers
Function
NewBetaToolRemovalBlock
(tool T)
betamessage.go:10862
↓ 10 callers
Function
ProfilePath
ProfilePath returns the path to configs/<profile>.json under dir.
config/writers.go:142
↓ 10 callers
Function
String
(s string)
field.go:10
↓ 10 callers
Method
String
()
tools/agenttoolset/search.go:325
↓ 10 callers
Function
WithoutOpenTelemetry
WithoutOpenTelemetry returns a RequestOption that turns off the OpenTelemetry spans of API calls. It is the short form of WithOpenTelemetryTraces(fals
option/tracing.go:54
↓ 10 callers
Method
append
(events ...event)
betasessiontoolrunner_fake_test.go:1231
↓ 10 callers
Method
attachSkills
(ids ...string)
environmentworker_fake_test.go:280
↓ 10 callers
Method
canAct
(thread string)
betasessiontoolrunner_fake_test.go:1070
↓ 10 callers
Function
clearCredentialEnv
clearCredentialEnv unsets everything a client reads from the environment and points the default credential chain at an empty config directory.
option/requestoption_test.go:239
↓ 10 callers
Function
created
Requests recorded on memoryServer.Received, in domain terms: paths and content. `was` is the pre-image content the request's precondition guards on —
lib/environments/memories_test.go:53
↓ 10 callers
Method
error
error aborts the encoding by panicking with err wrapped in jsonError.
internal/encoding/json/encode.go:329
↓ 10 callers
Method
idleFor
(s float64)
environmentworker_test.go:87
↓ 10 callers
Function
newClientWithVCR
(t *testing.T, cassette string)
toolrunner/runner_test.go:74
↓ 10 callers
Function
newServer
newServer records every request and answers each with a minimal message.
foundry/foundry_test.go:37
↓ 10 callers
Function
newTestClient
newTestClient stands up an httptest server and a client pointed at it, using a static token source so no real Google call is made.
googlecloud/googlecloud_test.go:56
↓ 10 callers
Function
read
read reads stream to its end and closes it. It ignores how the stream ended.
betamessagethreadutil_test.go:1915
↓ 10 callers
Function
requestedURLs
(captured []capturedRequest)
googlecloud/googlecloud_test.go:457
↓ 10 callers
Method
statuses
()
environmentworker_fake_test.go:154
↓ 10 callers
Function
toolResultBlockJSON
(toolUseID, text string)
betatoolrunner_test.go:486
↓ 10 callers
Function
toolResultMessageJSON
(results ...string)
betatoolrunner_test.go:482
↓ 10 callers
Function
tracedBy
(recorder trace.TracerProvider)
workpoller_test.go:64
↓ 10 callers
Method
yieldedAt
()
betasessiontoolrunner_fake_test.go:177
↓ 10 callers
Function
zipBytes
(t *testing.T, entries map[string]string)
tools/agenttoolset/skillarchive_test.go:18
↓ 9 callers
Method
All
All returns an iterator that yields all messages until the conversation completes. This is a convenience method for iterating over the entire conversa
betatoolrunner.go:1051
↓ 9 callers
Function
BetaWriteTool
BetaWriteTool returns an anthropic.BetaTool that writes file contents under env.Workdir or an allowed root, creating parent directories as needed.
tools/agenttoolset/fs.go:64
↓ 9 callers
Method
Default
()
shared/constant/constants.go:21
↓ 9 callers
Method
Error
()
tools/agenttoolset/agenttoolset.go:172
↓ 9 callers
Method
Finish
Finish is the session's last sync — call once, at a clean end. Server deletes skip the [DeleteCorroborationWindow] wait. Panics if called twice.
lib/environments/memories.go:608
↓ 9 callers
Method
Fork
Fork returns a new, independent thread with a copy of this thread's history, request fields and options. It sends no request.
betamessagethreadutil.go:204
↓ 9 callers
Method
IterationCount
IterationCount returns the number of API calls made so far, not counting compaction requests sent for CompactBeforeNextTurn. This is incremented each
betatoolrunner.go:331
↓ 9 callers
Method
MarshalJSON
()
internal/encoding/json/encode.go:218
↓ 9 callers
Function
MarshalRoot
(value any, writer *multipart.Writer)
internal/apiform/encoder.go:30
↓ 9 callers
Method
Root
()
lib/environments/memories.go:186
↓ 9 callers
Function
SaveProfile
SaveProfile persists cfg to configs/<profile>.json under dir. The write is atomic (.tmp sibling + rename); the target file is mode 0644 and the config
config/writers.go:281
↓ 9 callers
Method
SetupSkillsFromSession
SetupSkillsFromSession downloads the session agent's skills into {e.Workdir}/skills/<name>/. It reads the resolved agent off session, and for each ski
tools/agenttoolset/skills.go:52
↓ 9 callers
Method
Test
Send one test span, named `anthropic.test`, to the destination with its registered headers, once and without retries, and report the destination's ans
betaorganizationtelemetrydestination.go:230
↓ 9 callers
Function
WithOpenTelemetryPropagation
WithOpenTelemetryPropagation returns a RequestOption that turns the trace-context headers of the requests of API calls on or off, and leaves the spans
option/tracing.go:32
↓ 9 callers
Function
WithSpanRequestAttributes
WithSpanRequestAttributes returns a RequestOption that makes the call's OpenTelemetry span start with what attrs returns: the attributes that the SDK
internal/requestconfig/otel.go:120
↓ 9 callers
Function
WriteCredentials
WriteCredentials persists creds to path atomically. The target file is mode 0600 and the parent directory 0700. Callers typically build path with [Pro
config/writers.go:315
↓ 9 callers
Function
WriteExtras
(writer *multipart.Writer, extras map[string]any)
internal/apiform/encoder.go:484
↓ 9 callers
Function
assertAuthorization
(t *testing.T, sent http.Header, want string)
option/requestoption_test.go:230
↓ 9 callers
Function
bashCall
(id, command, thread string)
betasessiontoolrunner_test.go:290
↓ 9 callers
Method
check
(f *fakeSession, holds bool, violation string, args ...any)
betasessiontoolrunner_properties_test.go:222
↓ 9 callers
Method
continueWithoutResults
continueWithoutResults makes the thread move on from its calls, and the log shows no results for them.
betasessiontoolrunner_fake_test.go:624
↓ 9 callers
Method
delete
(published bool)
betasessiontoolrunner_fake_test.go:769
↓ 9 callers
Function
errorf
(format string, a ...any)
tools/agenttoolset/agenttoolset.go:213
↓ 9 callers
Function
extractArchiveBytes
extractArchiveBytes writes archive bytes to a temp file and extracts it, exercising the on-disk extraction path the real skill download now uses.
tools/agenttoolset/skillarchive_test.go:61
↓ 9 callers
Function
messageStartEvent
(id string)
betamessagethreadutil_test.go:1851
↓ 9 callers
Function
onlyRequest
(t *testing.T, requests *[]recordedRequest)
foundry/foundry_test.go:83
↓ 9 callers
Method
reorder
reorder gives streams the next append after the one that follows it, unless that puts a result before its call.
betasessiontoolrunner_fake_test.go:813
↓ 9 callers
Function
requireStatus
(t *testing.T, err error, status int)
betamessagethreadutil_test.go:316
↓ 9 callers
Function
sendTestRequest
(t *testing.T, client *Client)
aws/aws_test.go:72
↓ 9 callers
Function
sendTestRequest
(t *testing.T, client *Client)
googlecloud/googlecloud_test.go:73
↓ 9 callers
Function
systemToolChange
(block BetaContentBlockParamUnion)
betatoolrunner_test.go:111
↓ 9 callers
Function
textParts
(texts ...string)
internal/telemetry/content_test.go:76
↓ 9 callers
Function
threadEvent
Streams.
betamessagethreadutil_test.go:1847
↓ 9 callers
Method
toParam
()
messageutil.go:372
↓ 9 callers
Function
toolChangeMessageJSON
(blocks ...string)
betatoolrunner_test.go:494
↓ 9 callers
Function
toolRunnerStreamingTransport
toolRunnerStreamingTransport streams a tool call for the first request, and a final message for the next.
opentelemetry_toolrunner_test.go:90
↓ 9 callers
Method
typeDecoder
(t reflect.Type)
internal/apijson/decoder.go:93
↓ 9 callers
Function
unsetEnv
unsetEnv removes an environment variable for the duration of a test. It uses t.Setenv first to register the original value for automatic restoration a
config/config_test.go:31
↓ 9 callers
Function
userOAuthProfile
userOAuthProfile is a minimal valid user_oauth config body.
config/config_test.go:52
↓ 9 callers
Function
violations
(t *testing.T, maxCalls int, steps schedule, opts runOptions)
betasessiontoolrunner_properties_test.go:760
↓ 9 callers
Function
weatherRef
()
betatoolrunner_test.go:115
↓ 8 callers
Method
AppendMessages
AppendMessages adds messages to the conversation history. This is a convenience method equivalent to: runner.Params.Messages = append(runner.Params.
betatoolrunner.go:302
↓ 8 callers
Function
BetaBashTool
BetaBashTool returns an anthropic.BetaTool backed by a persistent bash session rooted at env.Workdir. The session is created lazily on first use and p
tools/agenttoolset/bash.go:422
↓ 8 callers
Function
BetaGrepTool
BetaGrepTool returns an anthropic.BetaTool that searches file contents under env.Workdir or an allowed root. It searches with the first rg on PATH who
tools/agenttoolset/search.go:53
↓ 8 callers
Method
Content
Content reports whether the spans carry the content of requests and responses.
internal/tracing/tracing.go:96
← previous
next →
301–400 of 17,396, ranked by callers