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
↓ 6 callers
Function
WithJSONSet
WithJSONSet returns a RequestOption that sets the body's JSON value associated with the key. The key accepts a string as defined by the [sjson format]
option/requestoption.go:302
↓ 6 callers
Function
WithLoadDefaultConfig
WithLoadDefaultConfig returns a request option which loads the default config for Amazon and registers middleware that intercepts request to the Messa
bedrock/bedrock.go:201
↓ 6 callers
Function
WithSpanRecorder
WithSpanRecorder returns a RequestOption that names the OpenTelemetry span of the call name, and makes the span record what recorder does.
internal/requestconfig/otel.go:80
↓ 6 callers
Function
WithoutMessageThreads
WithoutMessageThreads returns a RequestOption that marks the client as one whose API has no message threads.
internal/requestconfig/messagethreads.go:13
↓ 6 callers
Method
addWork
(name string, apply func(*fakeWorkAPI) bool, args ...any)
environmentworker_fake_test.go:220
↓ 6 callers
Function
assertBearer
(t *testing.T, server string, reqs []recordedRequest, want string)
internal/auth/integration_test.go:1545
↓ 6 callers
Method
capturing
(contexts *[]*agenttoolset.AgentToolContext)
environmentworker_test.go:105
↓ 6 callers
Function
cloneBetaMessageParams
cloneBetaMessageParams returns a copy of messages, which is never nil. Each element points at its message, so the message is copied as well.
betamessageutil.go:324
↓ 6 callers
Function
cutOffStream
cutOffStream is a stream whose connection drops after events.
betamessagethreadutil_test.go:1898
↓ 6 callers
Function
doSleep
(s float64)
environmentworker_properties_test.go:393
↓ 6 callers
Function
duringRequest
What the caller appends to the thread during the run. duringRequest returns an option that calls do on the caller's goroutine while request n of serve
betatoolrunnerthread_test.go:1089
↓ 6 callers
Method
emitOtherEvent
(eventType string)
betasessiontoolrunner_fake_test.go:660
↓ 6 callers
Method
endTurn
(thread string)
betasessiontoolrunner_fake_test.go:633
↓ 6 callers
Function
event
(name, data string)
lib/betafallback/streaming_test.go:63
↓ 6 callers
Method
expireTokens
(inSeconds float64)
environmentworker_fake_test.go:338
↓ 6 callers
Function
fileContents
(t *testing.T, path string)
internal/auth/integration_test.go:1666
↓ 6 callers
Function
isStatus
(err error, code int)
lib/environments/poller.go:497
↓ 6 callers
Function
last
(items []T)
betasessiontoolrunner_properties_test.go:299
↓ 6 callers
Function
newAPIServer
(t *testing.T)
option/requestoption_test.go:194
↓ 6 callers
Function
newDerivedTestClient
(t *testing.T, cfg ClientConfig)
googlecloud/googlecloud_test.go:401
↓ 6 callers
Function
newInputContent
newInputContent serializes the parameters system and messages, which are those JSON values: each part of the system instructions, and each part of eac
internal/telemetry/content.go:339
↓ 6 callers
Function
newMessage
(client *Client, opts ...option.RequestOption)
googlecloud/googlecloud_test.go:416
↓ 6 callers
Function
newMessageContent
newMessageContent serializes the message whose role is role, and each of parts once. A part that cannot be encoded is left out, so that the message st
internal/telemetry/content.go:317
↓ 6 callers
Function
newToolRunner
(ctx context.Context, client anthropic.Client, opts anthropic.SessionToolRunnerOptions)
betasessiontoolrunner_fake_test.go:1531
↓ 6 callers
Function
newWeatherRunner
newWeatherRunner builds a runner whose scripted server first asks for the "weather" tool and then answers. prefix messages (e.g. system tool changes)
betatoolrunner_test.go:199
↓ 6 callers
Function
notFound
()
betamessagethreadutil_test.go:1153
↓ 6 callers
Method
noteCoercion
()
internal/apijson/exactness.go:27
↓ 6 callers
Function
objectSchema
(properties map[string]any, required ...string)
tools/agenttoolset/agenttoolset.go:205
↓ 6 callers
Function
oidcFederationProfile
oidcFederationProfile is a minimal valid oidc_federation config body.
config/config_test.go:38
↓ 6 callers
Function
prop
(typ, description string)
tools/agenttoolset/agenttoolset.go:209
↓ 6 callers
Method
readIndex
readIndex returns the position of the last byte read.
internal/encoding/json/decode.go:227
↓ 6 callers
Function
request
(t *testing.T, f *fakeSession, method, path string, body any)
betasessiontoolrunner_fake_test.go:1581
↓ 6 callers
Function
requireGone
(t *testing.T, pids ...string)
tools/agenttoolset/bash_test.go:76
↓ 6 callers
Method
setSecret
(secret any)
environmentworker_fake_test.go:346
↓ 6 callers
Function
sha
(s string)
internal/filestore/filestore_test.go:22
↓ 6 callers
Function
sleep
(ctx context.Context, d time.Duration)
lib/environments/poller.go:467
↓ 6 callers
Method
startNewThread
startNewThread makes the next turn send the whole history under a new thread.
betamessagethreadutil.go:196
↓ 6 callers
Method
startTurn
(thread string)
betasessiontoolrunner_fake_test.go:514
↓ 6 callers
Method
stop
stop ends the span of a loop that the application stopped. The status stays unset.
betatoolrunner.go:125
↓ 6 callers
Function
stoppingSince
(f *fakeSession)
betasessiontoolrunner_properties_test.go:238
↓ 6 callers
Function
storesAt
storesAt wires a SessionMemoryStores to server over workdir without downloading — for the tests that assert on Download's own refusals.
lib/environments/memories_test.go:880
↓ 6 callers
Function
streamedAndNot
streamedAndNot makes the Messages call of api ("messages" or "beta") twice, streamed from stream and not streamed from message, reads both to the end,
opentelemetry_content_test.go:392
↓ 6 callers
Function
streamedReply
streamedReply is a whole streamed reply with one text block.
betamessagethreadutil_test.go:1889
↓ 6 callers
Function
streaming
(t *testing.T, opts fakeOptions)
betasessiontoolrunner_fake_test.go:1590
↓ 6 callers
Function
textMessages
(texts ...string)
internal/telemetry/content_test.go:27
↓ 6 callers
Function
timestamp
timestamp writes a whole second without a fraction, and never as the empty string.
environmentworker_fake_test.go:711
↓ 6 callers
Function
tokenServer
tokenServer answers token requests with an expiring token, which the SDK saves to the credentials file, and passes every other request to api.
internal/auth/integration_test.go:1603
↓ 6 callers
Function
tracedContext
tracedContext returns the context of a caller whose span has a trace state and whose context has baggage, so a request that propagates it has all of t
opentelemetry_propagation_test.go:25
↓ 6 callers
Method
typeEncoder
(t reflect.Type)
internal/apijson/encoder.go:64
↓ 6 callers
Function
types
(events []event)
betasessiontoolrunner_fake_test.go:1294
↓ 6 callers
Function
within
within reports whether path equals root or lies beneath it, comparing whole segments so /work does not contain /workextra. Both must be clean absolute
tools/agenttoolset/agenttoolset.go:343
↓ 5 callers
Method
Apply
(opts ...RequestOption)
internal/requestconfig/requestconfig.go:854
↓ 5 callers
Method
Cancel
Stop a `pending` or `running` dream. The response shows `status` as `canceled`, unless the dream reached `completed` or `failed` first. `usage` can k
betadream.go:209
↓ 5 callers
Method
CreateRoot
()
lib/environments/memories.go:185
↓ 5 callers
Method
Err
Err returns the first non-retryable error, or nil if iteration ended normally (consumer break, ctx cancellation, or Close). Construction-time option e
lib/environments/poller.go:390
↓ 5 callers
Method
Error
()
lib/environments/memories.go:163
↓ 5 callers
Method
Event
()
packages/ssestream/ssestream.go:17
↓ 5 callers
Method
Execute
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented en
client.go:295
↓ 5 callers
Method
GetType
Returns a pointer to the underlying variant's property, if present.
betaagent.go:6601
↓ 5 callers
Method
HashFile
(rel string)
lib/environments/memories.go:183
↓ 5 callers
Method
Heartbeat
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-
betaenvironmentwork.go:232
↓ 5 callers
Method
Index
Index reports the pinned fallback's zero-based index, or -1 when no fallback is pinned. Use it with SetIndex to persist a pin across processes. The pi
lib/betafallback/betafallback.go:40
↓ 5 callers
Function
NewBetaCacheControlEphemeralParam
()
betamessage.go:5739
↓ 5 callers
Function
NewBetaToolFromBytes
NewBetaToolFromBytes creates a BetaTool from JSON schema bytes.
toolrunner/tool.go:80
↓ 5 callers
Function
NewEnvironmentWorker
NewEnvironmentWorker returns an [EnvironmentWorker] bound to client. Call [EnvironmentWorker.Run] to start polling.
lib/environments/worker.go:161
↓ 5 callers
Function
NewStream
(decoder Decoder, err error)
packages/ssestream/ssestream.go:217
↓ 5 callers
Function
NewWorkPoller
NewWorkPoller returns a WorkPoller bound to ctx and client. WorkerID defaults to "<os.Hostname()>-<random hex>"; Logger defaults to slog.Default(). R
lib/environments/poller.go:242
↓ 5 callers
Method
Next
Next advances the poller. Returns true if a work item is now available via Current. Returns false when the bound context is cancelled, Close has been
lib/environments/poller.go:289
↓ 5 callers
Function
Open
Open resolves root; creates nothing — only [FileStore.CreateRoot] makes the folder. On platforms without O_NOFOLLOW it returns an error (a deployment
internal/filestore/filestore.go:128
↓ 5 callers
Method
ReadOnlyRoots
ReadOnlyRoots returns the root directories of stores attached read-only. The file tools consult this to refuse writes into read-only stores.
lib/environments/memories.go:370
↓ 5 callers
Function
SetErrorStatus
SetErrorStatus gives span the status of an operation that failed with err: ERROR, with error.type set to typ, or else derived from err. A canceled con
internal/tracing/tracing.go:569
↓ 5 callers
Function
With
With returns a request option (assignable to [option.RequestOption]) that appends value to the x-stainless-helper header rather than replacing it, bec
internal/stainlessheader/stainlessheader.go:40
↓ 5 callers
Function
WithFederationTokenProvider
WithFederationTokenProvider returns a [RequestOption] that authenticates requests using workload identity federation, exchanging a caller-supplied ide
option/requestoption.go:123
↓ 5 callers
Function
WithGoogleAuth
WithGoogleAuth returns a request option which loads the [Application Default Credentials] for Google Vertex AI and registers middleware that intercept
vertex/vertex.go:46
↓ 5 callers
Function
WithOpenTelemetryTracesMaxContentBytes
WithOpenTelemetryTracesMaxContentBytes returns a RequestOption that sets how many bytes of content the OpenTelemetry span of an API call carries at mo
option/tracing.go:92
↓ 5 callers
Function
WithProfile
WithProfile returns a [RequestOption] that loads the named profile from the default config directory (see [config.DefaultDir]) and authenticates reque
option/requestoption.go:446
↓ 5 callers
Function
as
(credential string)
environmentworker_properties_test.go:360
↓ 5 callers
Method
asAny
()
message.go:10703
↓ 5 callers
Function
assistantMessage
(text string)
betamessagethreadutil_test.go:174
↓ 5 callers
Method
attachMemory
(files map[string]string, mountPath, access string)
environmentworker_fake_test.go:292
↓ 5 callers
Function
attributeValues
(attrs []attribute.KeyValue)
internal/tracing/attributes_test.go:19
↓ 5 callers
Function
bedrockMiddleware
(signer *v4.Signer, cfg aws.Config)
bedrock/bedrock.go:322
↓ 5 callers
Function
betaThreadJSON
betaThreadJSON returns the request JSON of value, to tell whether two values are sent alike. The keys of every object are sorted, because extra fields
betamessagethreadutil.go:489
↓ 5 callers
Function
calledTool
(message *BetaMessage)
betatoolrunner_test.go:442
↓ 5 callers
Function
cancelOnFile
(t *testing.T, path string)
tools/agenttoolset/bash_test.go:42
↓ 5 callers
Function
canonicalize
canonicalize returns abs with every symlink resolved, or an error — never abs itself or a partly resolved path. It EvalSymlinks the longest existing a
tools/agenttoolset/agenttoolset.go:379
↓ 5 callers
Function
captureStderr
captureStderr redirects os.Stderr, where the SDK prints its warnings, and returns a function that restores it and reports what was written.
betatoolrunner_test.go:1637
↓ 5 callers
Method
check
(holds bool, violation string, args ...any)
environmentworker_properties_test.go:138
↓ 5 callers
Function
colorWith
(code string, s string)
examples/tool-runner-streaming/main.go:18
↓ 5 callers
Function
compactOnToolUse
(runner *turnRunner)
betatoolrunner_test.go:1620
↓ 5 callers
Function
concurrent
(limit int)
betasessiontoolrunner_test.go:117
↓ 5 callers
Function
credentialOptions
credentialOptions returns one of every option that supplies a credential. Call it after [clearCredentialEnv], because it saves the profile WithProfile
option/requestoption_test.go:327
↓ 5 callers
Function
definitionName
definitionName returns the name a tool definition carries on the wire, which for a server tool with its constant Name elided exists only once marshale
betatoolrunner.go:589
↓ 5 callers
Function
doing
(action workerAction)
environmentworker_properties_test.go:364
↓ 5 callers
Method
emitEarlyEndTurn
emitEarlyEndTurn makes the session's status say that the turn ended, though the subagent has not finished.
betasessiontoolrunner_fake_test.go:645
↓ 5 callers
Function
encodeChunkFrame
--- EventStream → SSE response normalization tests --- encodeChunkFrame writes an EventStream "chunk" event frame whose payload carries the given Anth
bedrock/bedrock_test.go:635
↓ 5 callers
Method
endTurnWith
(thread, stopReason string)
betasessiontoolrunner_fake_test.go:635
↓ 5 callers
Method
eof
eof tells the scanner that the end of input has been reached. It returns a scan status just as s.step does.
internal/encoding/json/scanner.go:159
↓ 5 callers
Function
execGrep
(ctx context.Context, raw json.RawMessage, env *AgentToolContext)
tools/agenttoolset/search.go:213
↓ 5 callers
Method
fail
(method string)
opentelemetry_test.go:1710
← previous
next →
501–600 of 17,396, ranked by callers