MCPcopy Create free account

hub / github.com/anthropics/anthropic-sdk-go / functions

Functions17,396 in github.com/anthropics/anthropic-sdk-go

↓ 8 callersMethodDownload
Download File When the returned error is an [*apierror.Error], compare the [apierror.Error.ErrorCode] against these values. - [ErrorCodeClaudeCodeKe
file.go:123
↓ 8 callersMethodEnd
(...trace.SpanEndOption)
client_test.go:1284
↓ 8 callersFunctionExchangeFederationAssertion
ExchangeFederationAssertion performs an OAuth 2.0 jwt-bearer exchange against the Anthropic token endpoint and returns the minted credentials. Federa
config/federation.go:144
↓ 8 callersMethodGetType
Returns a pointer to the underlying variant's property, if present.
betamessage.go:21861
↓ 8 callersMethodIsRecording
()
internal/tracing/attributes_test.go:176
↓ 8 callersFunctionNewTokenCache
NewTokenCache returns a [TokenCache] that delegates to the given provider. The handler is passed through to the provider on every fetch; the base URL
internal/auth/cache.go:52
↓ 8 callersFunctionProfileCredentialsPath
ProfileCredentialsPath returns the path to credentials/<profile>.json under dir.
config/writers.go:147
↓ 8 callersMethodSetExtraFields
SetExtraFields adds extra fields to the JSON object. SetExtraFields will override any existing fields with the same key. For security reasons, ensure
packages/param/param.go:157
↓ 8 callersMethodSetLoseUploadResponses
(lose bool)
lib/environments/memories_test.go:160
↓ 8 callersFunctionValueOf
ValueOf gives the default value of a constant from its type. It's helpful when constructing constants as variants in a one-of. Note that empty structs
shared/constant/constants.go:27
↓ 8 callersMethodasAny
()
betamessage.go:14619
↓ 8 callersFunctionbetaRequest
betaRequest returns the request that a middleware gets from a beta method that posts body to v1/messages.
lib/betafallback/betafallback_test.go:127
↓ 8 callersMethodblockedOn
(thread string)
betasessiontoolrunner_fake_test.go:1075
↓ 8 callersMethoddeliverInOneChunk
deliverInOneChunk makes the runner read all queued events at once, and its first read does not wait.
betasessiontoolrunner_fake_test.go:818
↓ 8 callersMethoddispatch
dispatch polls and acks the item with token_0, for a worker's HandleItem.
environmentworker_fake_test.go:269
↓ 8 callersFunctiondownloadedMode
downloadedMode is downloadedStores with a SyncDeletions mode and a fake clock at time zero.
lib/environments/memories_test.go:1671
↓ 8 callersFunctionfallbackParams
fallbackParams are params that name fallbackModel as a fallback.
betamessagethreadutil_test.go:278
↓ 8 callersFunctionisSpace
(c byte)
internal/encoding/json/scanner.go:199
↓ 8 callersFunctionisolateProfileEnv
(t *testing.T)
internal/auth/integration_test.go:1619
↓ 8 callersFunctionmustStores
mustStores is NewSessionMemoryStores for options a test knows are valid.
lib/environments/memories_test.go:460
↓ 8 callersFunctionnewTurnRunnerOver
(thread *BetaMessageThread, stream bool, tools ...BetaTool)
betatoolrunnerthread_test.go:691
↓ 8 callersFunctionrequeuedAndClaimed
(now float64)
environmentworker_test.go:61
↓ 8 callersFunctionrequireStatus
(t *testing.T, status int, err error)
workpoller_test.go:57
↓ 8 callersMethodresolveUnderRoot
(rel string)
internal/filestore/filestore.go:347
↓ 8 callersFunctionresultJSON
(call anthropic.DispatchedToolCall)
betasessiontoolrunner_test.go:148
↓ 8 callersMethodresumeTerminatedThread
resumeTerminatedThread is late input that makes the subagent's terminated thread run again.
betasessiontoolrunner_fake_test.go:745
↓ 8 callersFunctionrunTraced
(t *testing.T, steps schedule, opts runOptions, client ...option.RequestOption)
betasessiontoolrunner_test.go:2097
↓ 8 callersFunctionsaveCredentials
(t *testing.T, accessToken string, expiresIn time.Duration)
internal/auth/integration_test.go:1655
↓ 8 callersFunctionsecretOf
(token string)
environmentworker_fake_test.go:728
↓ 8 callersMethodsendResult
(id string)
betasessiontoolrunner_fake_test.go:690
↓ 8 callersFunctionspanNamed
(t *testing.T, recorder *spanRecorder, name string)
betasessiontoolrunner_test.go:2108
↓ 8 callersFunctionspeedKeys
speedKeys lists the speed each request body carried, absent for a body without the key.
lib/betafallback/betafallback_test.go:1325
↓ 8 callersFunctiontarget
(ev event)
betasessiontoolrunner_fake_test.go:1303
↓ 8 callersMethodthen
(other schedule)
betasessiontoolrunner_fake_test.go:468
↓ 8 callersMethodtoParam
()
betamessageutil.go:363
↓ 8 callersMethodtypeEncoder
(t reflect.Type)
internal/apiquery/encoder.go:44
↓ 8 callersFunctionwantSize
wantSize fails the test unless size is the length of the values of the content attributes in attrs.
internal/telemetry/content_test.go:97
↓ 8 callersFunctionweatherThreadParams
Runner over a thread.
betatoolrunnerthread_test.go:673
↓ 8 callersFunctionwithClock
withClock swaps in a fake clock at time zero and returns a handle to it.
lib/environments/memories_test.go:559
↓ 8 callersFunctionwriteMessagesResponse
writeMessagesResponse writes a canned successful Messages API response.
bedrock/bedrockmantle_test.go:41
↓ 7 callersFunctionActiveConfigPath
ActiveConfigPath returns the path to the active_config pointer file under dir.
config/writers.go:152
↓ 7 callersMethodAddTools
AddTools gives the model more tools without changing Params.Tools, which keeps the prompt cache. Each definition goes out with the next request. The r
betatoolrunner.go:233
↓ 7 callersFunctionBetaAgentToolset20260401
BetaAgentToolset20260401 returns the six built-in agent_toolset_20260401 implementations bound to env, in the anthropic.BetaTool shape the SDK's tool
tools/agenttoolset/agenttoolset.go:126
↓ 7 callersFunctionEnvCredentials
EnvCredentials resolves OIDC-federation credentials from environment variables. Returns a usable result when the three required vars are all set. Othe
internal/auth/default.go:25
↓ 7 callersFunctionResolveConfig
ResolveConfig resolves all configuration values from ClientConfig fields and environment variable fallbacks, parameterized by ResolveParams.
internal/awsauth/awsauth.go:77
↓ 7 callersFunctionSigV4Middleware
SigV4Middleware returns an HTTP middleware that signs requests using AWS SigV4 with the given service name.
internal/awsauth/awsauth.go:226
↓ 7 callersMethodToParam
()
betamessageutil.go:311
↓ 7 callersFunctionWithOpenTelemetryTraces
WithOpenTelemetryTraces returns a RequestOption that turns the OpenTelemetry spans of API calls, and the trace-context headers of their requests, on o
option/tracing.go:45
↓ 7 callersFunctionWithResponseBodyInto
WithResponseBodyInto returns a RequestOption that overwrites the deserialization target with the given destination. If provided, we don't deserialize
option/requestoption.go:348
↓ 7 callersMethodapplyStep
(s step)
betasessiontoolrunner_fake_test.go:1507
↓ 7 callersFunctionbetaContentParams
()
opentelemetry_content_test.go:381
↓ 7 callersMethodcredentials
()
environmentworker_fake_test.go:158
↓ 7 callersMethodemit
(eventType string, data []byte)
lib/betafallback/streaming.go:270
↓ 7 callersFunctionended
(span sdktrace.ReadOnlySpan)
opentelemetry_test.go:102
↓ 7 callersMethodheaders
(name string)
environmentworker_fake_test.go:162
↓ 7 callersFunctionmarkedUserJSON
(text string)
betamessagethreadutil_test.go:206
↓ 7 callersFunctionnewCappedRunnerParams
(maxIterations int)
betatoolrunner_test.go:1229
↓ 7 callersFunctionoutputMessages
outputMessages returns gen_ai.output.messages of one message, which has parts.
internal/telemetry/content_test.go:46
↓ 7 callersFunctionperformingWork
(actions ...[]workerAction)
environmentworker_properties_test.go:350
↓ 7 callersFunctionreadCredentialsFile
(path string)
internal/auth/credentials_file.go:30
↓ 7 callersFunctionrequireBackoffs
(t *testing.T, want []float64, attempts []float64)
betasessiontoolrunner_test.go:105
↓ 7 callersFunctionrequireLocalError
requireLocalError requires an error that did not come from a response.
betamessagethreadutil_test.go:324
↓ 7 callersFunctionreturning
(name string, content blocks, err error)
betasessiontoolrunner_test.go:135
↓ 7 callersFunctionrunToToolResults
runToToolResults drives the runner to completion and returns every tool_result block it appended to the conversation.
betatoolrunner_test.go:83
↓ 7 callersFunctionsentHeaders
sentHeaders builds a client from clientOpts, sends one request with reqOpts, and returns the headers that reached the server.
option/requestoption_test.go:221
↓ 7 callersFunctionstateEndValue
stateEndValue is the state after completing a value, such as after reading `{}` or `true` or `["x"`.
internal/encoding/json/scanner.go:279
↓ 7 callersMethodstatus
()
betasessiontoolrunner_fake_test.go:863
↓ 7 callersFunctionstubAdditionJSON
stubAdditionJSON is the tool_addition block AddTools sends for a stubBetaTool.
betatoolrunner_test.go:503
↓ 7 callersFunctionsummaryJSON
()
betatoolrunnerthread_test.go:39
↓ 7 callersFunctiontextCutOff
textCutOff is a stream that drops inside the text block of reply id, after text.
betamessagethreadutil_test.go:1910
↓ 7 callersMethodtool
(label string)
betatoolrunner_test.go:392
↓ 7 callersMethodtypeEncoder
(t reflect.Type)
internal/apiform/encoder.go:78
↓ 7 callersFunctionunmarshalBetaContentBlockParam
(t *testing.T, jsonData string)
betamessageutil_test.go:13
↓ 7 callersFunctionweatherTool
(t *testing.T)
toolrunner/runner_test.go:56
↓ 7 callersFunctionwithShell
(t *testing.T, limit, calls int)
betasessiontoolrunner_test.go:304
↓ 7 callersMethodwithoutClientRetries
()
environmentworker_test.go:77
↓ 7 callersFunctionwrittenByFallback
writtenByFallback returns response as fallbackModel writes it: the content starts with a fallback block, and the usage has a fallback_message entry.
betamessagethreadutil_test.go:251
↓ 6 callersMethodAsFallback
()
betamessage.go:10458
↓ 6 callersMethodClose
Close kills the shell and its background jobs, and removes the saved output. Safe to call multiple times.
tools/agenttoolset/bash.go:394
↓ 6 callersFunctionCompareGolden
CompareGolden compares the given string with the golden file at path. If UPDATE_GOLDEN=1, it overwrites the file with the provided contents.
internal/testutil/golden.go:11
↓ 6 callersMethodDo
(*http.Request)
option/requestoption.go:178
↓ 6 callersMethodErr
()
packages/ssestream/ssestream.go:20
↓ 6 callersMethodExec
Exec runs cmd in the persistent shell and returns its output and exit code. The output is stdout and then stderr, or stderr first if cmd failed. A tim
tools/agenttoolset/bash.go:247
↓ 6 callersMethodGetNextPage
GetNextPage returns the next page as defined by this pagination style. When there is no next page, this function will return a 'nil' for the page valu
packages/pagination/pagination.go:48
↓ 6 callersFunctionIsNull
IsNull returns true if v was set to the JSON value null. To set a param to null use [NullStruct], [Null], [NullMap], or [NullSlice] depending on the
packages/param/param.go:79
↓ 6 callersFunctionMarshalWithExtras
MarshalWithExtras is used to marshal a struct with additional properties. Stability for the API of MarshalWithExtras is not guaranteed.
packages/param/encoder.go:43
↓ 6 callersMethodNew
Create a Credential
betavaultcredential.go:45
↓ 6 callersMethodNew
Create Deployment
betadeployment.go:45
↓ 6 callersFunctionNewBashSession
NewBashSession starts bash in dir. env selects the base environment for the spawned shell. When nil the shell inherits the runner's environment minus
tools/agenttoolset/bash.go:97
↓ 6 callersFunctionNewClient
NewClient generates a new client with the default option read from the environment (ANTHROPIC_API_KEY, ANTHROPIC_WEBHOOK_SIGNING_KEY, ANTHROPIC_AUTH_T
client.go:242
↓ 6 callersFunctionNewMiddleware
NewMiddleware returns bearer-auth middleware serving tokens from cache. Tokens are exchanged at, and only attached to requests for, cfg.BaseURL — a re
internal/auth/middleware.go:33
↓ 6 callersFunctionNewReportPageCursorAutoPager
(page *ReportPageCursor[T], err error)
packages/pagination/pagination.go:570
↓ 6 callersFunctionNewUserOAuthAuthentication
NewUserOAuthAuthentication returns a populated [AuthenticationInfo] for the user_oauth variant. Pass an empty clientID to describe a profile whose acc
config/config.go:196
↓ 6 callersMethodPost
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and respons
client.go:309
↓ 6 callersMethodRaw
()
internal/apijson/field.go:23
↓ 6 callersMethodResultsStreaming
Streams the results of a Message Batch as a `.jsonl` file. Each line in the file is a JSON object containing the result of a single request in the Me
messagebatch.go:226
↓ 6 callersMethodSetResponseBodyInto
SetResponseBodyInto makes dst the value that the SDK decodes the body of the response into, as NewRequestConfig does with its own. A next page calls i
internal/requestconfig/otel.go:207
↓ 6 callersMethodSpanContext
()
opentelemetry_test.go:1743
↓ 6 callersFunctionValidateRequestPath
ValidateRequestPath returns an error if u, a URL or a path, fails [url.Parse] or would be sent with a path segment that is "." or "..", or has nothing
internal/requestconfig/url.go:22
↓ 6 callersFunctionWithHeaderDel
WithHeaderDel returns a RequestOption that deletes the header value(s) associated with the given key.
option/requestoption.go:259
← previousnext →401–500 of 17,396, ranked by callers