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
↓ 19 callers
Method
withLatency
(latency float64, pageSize int)
betasessiontoolrunner_test.go:125
↓ 18 callers
Method
Apply
(*RequestConfig)
internal/requestconfig/requestconfig.go:84
↓ 18 callers
Function
BetaReadTool
BetaReadTool returns an anthropic.BetaTool that reads file contents under env.Workdir or an allowed root.
tools/agenttoolset/fs.go:45
↓ 18 callers
Method
NextMessage
NextMessage advances the conversation by one turn. It executes any pending tool calls from the previous message, then makes an API call to get the mod
betatoolrunner.go:978
↓ 18 callers
Method
cancelConsumer
()
betasessiontoolrunner_fake_test.go:776
↓ 18 callers
Function
makeStaticAWSConfig
(region string)
bedrock/bedrockmantle_test.go:28
↓ 18 callers
Function
marshal
marshal returns the JSON of v, a value of the content attributes, with <, > and & as they are: a span is not HTML. It is "" when v cannot be encoded,
internal/telemetry/content.go:293
↓ 18 callers
Function
refusalStream
refusalStream is a stream from model that refuses mid-text with the given stop_details fields.
lib/betafallback/streaming_test.go:69
↓ 18 callers
Function
requireUnthreaded
requireUnthreaded requires a request with messages, no thread field and no threads beta.
betamessagethreadutil_test.go:355
↓ 18 callers
Function
setPropagator
(t *testing.T, p propagation.TextMapPropagator)
opentelemetry_test.go:155
↓ 18 callers
Method
stopFromOutside
(force bool)
environmentworker_fake_test.go:254
↓ 18 callers
Function
toJSON
(v any)
betasessiontoolrunner_fake_test.go:1314
↓ 17 callers
Method
AllStreaming
AllStreaming returns an iterator of iterators, where each inner iterator yields streaming events for a single turn of the conversation. The outer iter
betatoolrunner.go:1208
↓ 17 callers
Function
NewClient
NewClient creates a new Claude Models on Google Cloud (Anthropic managed) client with the given configuration. Authentication uses Google credentials
googlecloud/googlecloud.go:92
↓ 17 callers
Function
NewOIDCFederationCredentials
NewOIDCFederationCredentials returns a [TokenProvider] that exchanges an OIDC identity token for a short-lived Anthropic access token via the OAuth to
internal/auth/workload.go:61
↓ 17 callers
Function
WithoutEnvironmentDefaults
WithoutEnvironmentDefaults returns a marker [RequestOption] that, when passed to anthropic.NewClient, causes it to skip the environment-based credenti
option/requestoption.go:503
↓ 17 callers
Function
eachEntry
(t *testing.T, cases map[K]V, test func(t *testing.T, key K, c V))
betasessiontoolrunner_test.go:61
↓ 17 callers
Function
feed
(acc *BetaManagedAgentsEventAccumulator, evs ...BetaManagedAgentsStreamSessionEventsUnion)
betasessionutil_test.go:31
↓ 17 callers
Function
id
(ev event)
betasessiontoolrunner_fake_test.go:1290
↓ 17 callers
Function
newThreadServer
(t *testing.T, script ...threadResponse)
betamessagethreadutil_test.go:73
↓ 16 callers
Function
BetaEditTool
BetaEditTool returns an anthropic.BetaTool that performs unique-match string replacement in a file under env.Workdir or an allowed root.
tools/agenttoolset/fs.go:79
↓ 16 callers
Method
FlushWrites
FlushWrites uploads new and changed files and does nothing else — no server deletes, no local removals, no pulls. For a session that went idle, and t
lib/environments/memories.go:677
↓ 16 callers
Function
HandleRecovered
HandleRecovered reports recovered, what recover returned while the SDK recorded telemetry, to the error handler that the application registered with O
internal/tracing/tracing.go:184
↓ 16 callers
Function
NewBetaUserMessage
(blocks ...BetaContentBlockParamUnion)
betamessage.go:14594
↓ 16 callers
Function
NewMantleClient
NewMantleClient creates a new Bedrock Mantle client with the given configuration. Only the Messages API (/v1/messages) and its subpaths are supported
bedrock/bedrockmantle.go:93
↓ 16 callers
Method
Started
Started returns every span that has started, in the order they started.
opentelemetry_test.go:91
↓ 16 callers
Function
WithRequestTimeout
WithRequestTimeout returns a RequestOption that sets the timeout for each request attempt. This should be smaller than the timeout defined in the cont
option/requestoption.go:390
↓ 16 callers
Method
client
(opts ...option.RequestOption)
betamessagethreadutil_test.go:122
↓ 16 callers
Function
creditTokenBody
creditTokenBody is the decoded object form the middleware sends when it redeems a refusal's fallback_credit_token: best_effort mode, so a token-layer
lib/betafallback/betafallback_test.go:99
↓ 16 callers
Function
runOnCurrentClock
(t require.TestingT, steps schedule, opts runOptions)
betasessiontoolrunner_fake_test.go:1463
↓ 15 callers
Method
Get
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
client.go:302
↓ 15 callers
Function
NewPageAutoPager
(page *Page[T], err error)
packages/pagination/pagination.go:104
↓ 15 callers
Method
Run
Run polls the environment and services each claimed session until ctx is cancelled. A cancelled ctx (deadline or otherwise) is normal termination and
lib/environments/worker.go:191
↓ 15 callers
Method
SendStreaming
SendStreaming is like [BetaMessageThread.Send] and returns the stream of the reply. The turn is in progress until the stream ends or is closed, so alw
betamessagethreadutil.go:245
↓ 15 callers
Method
Token
Token returns a valid access token, fetching or refreshing via the provider if necessary. baseURL is forwarded to the provider for token-exchange / re
internal/auth/cache.go:59
↓ 15 callers
Function
WithAuthToken
WithAuthToken returns a RequestOption that sets the client setting "auth_token". This is a credential option. See anthropic.NewClient for how those c
option/requestoption.go:615
↓ 15 callers
Function
WithCredentials
WithCredentials returns a request option which uses the provided credentials for Google Vertex AI and registers middleware that intercepts request to
vertex/vertex.go:96
↓ 15 callers
Method
always
(name string, apply func(*fakeWorkAPI), args ...any)
environmentworker_fake_test.go:224
↓ 15 callers
Method
cancelledAt
(until float64)
betasessiontoolrunner_test.go:130
↓ 15 callers
Method
exhaustRetries
(thread string)
betasessiontoolrunner_fake_test.go:616
↓ 15 callers
Method
on
(v variant)
environmentworker_test.go:72
↓ 15 callers
Function
onReply
onReply returns a callback for run that calls do with the reply id.
betatoolrunnerthread_test.go:61
↓ 15 callers
Function
readStream
readStream sends a turn as a stream and reads it to its end.
betamessagethreadutil_test.go:1922
↓ 15 callers
Function
requireYieldedOnce
(t *testing.T, ids []string, want ...string)
betatoolrunner_test.go:1237
↓ 15 callers
Function
unsupportedRequest
unsupportedRequest is a 400 thread_unsupported_request that names unsupported.
betamessagethreadutil_test.go:301
↓ 15 callers
Function
withTools
(tools ...anthropic.BetaTool)
betasessiontoolrunner_test.go:121
↓ 15 callers
Function
writeCredentials
(t *testing.T, path string, data map[string]any)
internal/auth/credentials_file_test.go:20
↓ 15 callers
Method
writeNote
(name, text string)
environmentworker_fake_test.go:303
↓ 14 callers
Function
CloseAll
CloseAll releases resources held by any tools that implement io.Closer. Each Close runs under its own recover so one panicking tool cannot skip cleanu
tools/agenttoolset/agenttoolset.go:154
↓ 14 callers
Method
Download
Download downloads every attached store's memories to disk. session arrives already fetched — one snapshot shared with the skills download, so the tw
lib/environments/memories.go:389
↓ 14 callers
Method
Error
()
config/federation.go:125
↓ 14 callers
Method
Put
(rel string, data []byte, opts ...filestore.PutOption)
lib/environments/memories.go:180
↓ 14 callers
Method
SpanContext
()
client_test.go:1266
↓ 14 callers
Method
UnmarshalJSON
([]byte)
internal/encoding/json/decode.go:124
↓ 14 callers
Function
WithBetaFallbackState
WithBetaFallbackState returns a request option carrying state for [BetaRefusalFallbackMiddleware]. Pass the same state on every request that should sh
lib/betafallback/betafallback.go:53
↓ 14 callers
Method
attributes
attributes returns the content attributes of the call, and the length of their values: gen_ai.request.stop_sequences, gen_ai.system_instructions, gen_
internal/telemetry/content.go:380
↓ 14 callers
Function
canonicalRoot
canonicalRoot resolves a configured root (Workdir, an AllowedRoots or ReadOnlyRoots entry) the way resolvePath resolves targets, so both sides of a co
tools/agenttoolset/agenttoolset.go:353
↓ 14 callers
Function
continueUnthreadedParams
()
betamessagethreadutil_test.go:159
↓ 14 callers
Method
item
()
environmentworker_fake_test.go:213
↓ 14 callers
Method
next
(ctx context.Context)
betasessiontoolrunner.go:1231
↓ 14 callers
Function
resolveConfig
resolveConfig applies environment-variable fallbacks. It does not touch the network; ADC-based project backfill happens in createClientOptions. Locati
googlecloud/auth.go:58
↓ 14 callers
Function
seconds
(s float64)
betasessiontoolrunner_fake_test.go:59
↓ 14 callers
Function
sseEvent
(t *testing.T, raw string)
betasessionutil_test.go:18
↓ 14 callers
Function
unthreaded
unthreaded opts a runner out of message threads, for a test that reads the whole history from each request rather than what a thread sends.
betatoolrunner_test.go:1412
↓ 14 callers
Method
until
(s float64)
environmentworker_test.go:67
↓ 13 callers
Method
Accumulate
Accumulate builds up the Message incrementally from a MessageStreamEvent. The Message then can be used as any other Message, including the Message.JSO
betamessageutil.go:22
↓ 13 callers
Method
Accumulate
Accumulate builds up the Message incrementally from a MessageStreamEvent. The Message then can be used as any other Message, including the Message.JSO
messageutil.go:25
↓ 13 callers
Method
Delete
(path string)
lib/environments/memories_test.go:136
↓ 13 callers
Method
Index
()
packages/pagination/pagination.go:136
↓ 13 callers
Function
NewDecoder
(res *http.Response)
packages/ssestream/ssestream.go:23
↓ 13 callers
Method
SetAttributes
(attrs ...attribute.KeyValue)
internal/tracing/attributes_test.go:178
↓ 13 callers
Method
Stop
Stop a work item, initiating graceful or forced shutdown. When the returned error is an [*apierror.Error], compare the [apierror.Error.ErrorCode] aga
betaenvironmentwork.go:334
↓ 13 callers
Method
archive
archive can show only on the streams that are open now. If it is not published, they stay open.
betasessiontoolrunner_fake_test.go:762
↓ 13 callers
Function
clearEnv
(t *testing.T)
foundry/foundry_test.go:18
↓ 13 callers
Function
contentAttributes
contentAttributes returns the values of gen_ai.input.messages and gen_ai.output.messages in attrs, and anthropic.content.truncated when attrs has it.
internal/telemetry/content_test.go:60
↓ 13 callers
Function
contentParams
()
opentelemetry_content_test.go:29
↓ 13 callers
Function
deletedReq
(path, was string)
lib/environments/memories_test.go:59
↓ 13 callers
Function
eventDelta
(t *testing.T, eventID, text string, index int)
betasessionutil_test.go:27
↓ 13 callers
Function
eventStart
(t *testing.T, eventID string)
betasessionutil_test.go:23
↓ 13 callers
Function
newMemoryServer
(t *testing.T, initial map[string]string, access string)
lib/environments/memories_test.go:122
↓ 13 callers
Function
toolCallTurnJSON
(id, name string)
betatoolrunner_test.go:380
↓ 12 callers
Function
Marshal
Marshal returns the JSON encoding of v. Marshal traverses the value v recursively. If an encountered value implements [Marshaler] and is not a nil po
internal/encoding/json/encode.go:177
↓ 12 callers
Function
NewBetaTextBlock
(text string)
betamessage.go:10640
↓ 12 callers
Method
NextStreaming
NextStreaming advances the conversation by one turn with streaming. It executes any pending tool calls from the previous message, then makes a streami
betatoolrunner.go:1109
↓ 12 callers
Method
Start
(ctx context.Context, _ string, _ ...trace.SpanStartOption)
client_test.go:1250
↓ 12 callers
Function
WithOpenTelemetryConversationID
WithOpenTelemetryConversationID returns a RequestOption that links the calls it applies to into one conversation, with an ID that the application choo
option/opentelemetry.go:17
↓ 12 callers
Function
applied
(t *testing.T, f *fakeSession, steps schedule)
betasessiontoolrunner_fake_test.go:1573
↓ 12 callers
Method
in
(workdir string)
environmentworker_test.go:91
↓ 12 callers
Method
models
()
lib/betafallback/betafallback_test.go:80
↓ 12 callers
Function
newFakeSession
(opts fakeOptions)
betasessiontoolrunner_fake_test.go:392
↓ 12 callers
Function
newTestCache
(provider TokenProvider)
internal/auth/cache_test.go:14
↓ 12 callers
Function
newTestClient
(t *testing.T, cfg ClientConfig)
aws/aws_test.go:58
↓ 12 callers
Method
now
()
betasessiontoolrunner_fake_test.go:412
↓ 12 callers
Function
pinnedThreadParams
pinnedThreadParams are params with a System and Tools.
betamessagethreadutil_test.go:957
↓ 12 callers
Method
send
send sends request, on the thread when there is one.
betatoolrunner.go:835
↓ 12 callers
Method
setStatus
(thread, status string, opts statusOptions)
betasessiontoolrunner_fake_test.go:1164
↓ 12 callers
Function
textBlocks
(text string)
betasessiontoolrunner_fake_test.go:1341
↓ 12 callers
Function
threadRejection
threadRejection is an error response whose details carry errorCode.
betamessagethreadutil_test.go:292
↓ 11 callers
Method
AgentMessageText
(eventID string)
betasessionutil.go:51
↓ 11 callers
Method
CountTokens
Count the number of tokens in a Message. The Token Count API can be used to count the number of tokens in a Message, including tools, images, and doc
message.go:222
← previous
next →
201–300 of 17,396, ranked by callers