MCPcopy Create free account

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

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

↓ 6 callersFunctionWithJSONSet
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 callersFunctionWithLoadDefaultConfig
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 callersFunctionWithSpanRecorder
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 callersFunctionWithoutMessageThreads
WithoutMessageThreads returns a RequestOption that marks the client as one whose API has no message threads.
internal/requestconfig/messagethreads.go:13
↓ 6 callersMethodaddWork
(name string, apply func(*fakeWorkAPI) bool, args ...any)
environmentworker_fake_test.go:220
↓ 6 callersFunctionassertBearer
(t *testing.T, server string, reqs []recordedRequest, want string)
internal/auth/integration_test.go:1545
↓ 6 callersMethodcapturing
(contexts *[]*agenttoolset.AgentToolContext)
environmentworker_test.go:105
↓ 6 callersFunctioncloneBetaMessageParams
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 callersFunctioncutOffStream
cutOffStream is a stream whose connection drops after events.
betamessagethreadutil_test.go:1898
↓ 6 callersFunctiondoSleep
(s float64)
environmentworker_properties_test.go:393
↓ 6 callersFunctionduringRequest
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 callersMethodemitOtherEvent
(eventType string)
betasessiontoolrunner_fake_test.go:660
↓ 6 callersMethodendTurn
(thread string)
betasessiontoolrunner_fake_test.go:633
↓ 6 callersFunctionevent
(name, data string)
lib/betafallback/streaming_test.go:63
↓ 6 callersMethodexpireTokens
(inSeconds float64)
environmentworker_fake_test.go:338
↓ 6 callersFunctionfileContents
(t *testing.T, path string)
internal/auth/integration_test.go:1666
↓ 6 callersFunctionisStatus
(err error, code int)
lib/environments/poller.go:497
↓ 6 callersFunctionlast
(items []T)
betasessiontoolrunner_properties_test.go:299
↓ 6 callersFunctionnewAPIServer
(t *testing.T)
option/requestoption_test.go:194
↓ 6 callersFunctionnewDerivedTestClient
(t *testing.T, cfg ClientConfig)
googlecloud/googlecloud_test.go:401
↓ 6 callersFunctionnewInputContent
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 callersFunctionnewMessage
(client *Client, opts ...option.RequestOption)
googlecloud/googlecloud_test.go:416
↓ 6 callersFunctionnewMessageContent
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 callersFunctionnewToolRunner
(ctx context.Context, client anthropic.Client, opts anthropic.SessionToolRunnerOptions)
betasessiontoolrunner_fake_test.go:1531
↓ 6 callersFunctionnewWeatherRunner
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 callersFunctionnotFound
()
betamessagethreadutil_test.go:1153
↓ 6 callersMethodnoteCoercion
()
internal/apijson/exactness.go:27
↓ 6 callersFunctionobjectSchema
(properties map[string]any, required ...string)
tools/agenttoolset/agenttoolset.go:205
↓ 6 callersFunctionoidcFederationProfile
oidcFederationProfile is a minimal valid oidc_federation config body.
config/config_test.go:38
↓ 6 callersFunctionprop
(typ, description string)
tools/agenttoolset/agenttoolset.go:209
↓ 6 callersMethodreadIndex
readIndex returns the position of the last byte read.
internal/encoding/json/decode.go:227
↓ 6 callersFunctionrequest
(t *testing.T, f *fakeSession, method, path string, body any)
betasessiontoolrunner_fake_test.go:1581
↓ 6 callersFunctionrequireGone
(t *testing.T, pids ...string)
tools/agenttoolset/bash_test.go:76
↓ 6 callersMethodsetSecret
(secret any)
environmentworker_fake_test.go:346
↓ 6 callersFunctionsha
(s string)
internal/filestore/filestore_test.go:22
↓ 6 callersFunctionsleep
(ctx context.Context, d time.Duration)
lib/environments/poller.go:467
↓ 6 callersMethodstartNewThread
startNewThread makes the next turn send the whole history under a new thread.
betamessagethreadutil.go:196
↓ 6 callersMethodstartTurn
(thread string)
betasessiontoolrunner_fake_test.go:514
↓ 6 callersMethodstop
stop ends the span of a loop that the application stopped. The status stays unset.
betatoolrunner.go:125
↓ 6 callersFunctionstoppingSince
(f *fakeSession)
betasessiontoolrunner_properties_test.go:238
↓ 6 callersFunctionstoresAt
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 callersFunctionstreamedAndNot
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 callersFunctionstreamedReply
streamedReply is a whole streamed reply with one text block.
betamessagethreadutil_test.go:1889
↓ 6 callersFunctionstreaming
(t *testing.T, opts fakeOptions)
betasessiontoolrunner_fake_test.go:1590
↓ 6 callersFunctiontextMessages
(texts ...string)
internal/telemetry/content_test.go:27
↓ 6 callersFunctiontimestamp
timestamp writes a whole second without a fraction, and never as the empty string.
environmentworker_fake_test.go:711
↓ 6 callersFunctiontokenServer
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 callersFunctiontracedContext
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 callersMethodtypeEncoder
(t reflect.Type)
internal/apijson/encoder.go:64
↓ 6 callersFunctiontypes
(events []event)
betasessiontoolrunner_fake_test.go:1294
↓ 6 callersFunctionwithin
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 callersMethodApply
(opts ...RequestOption)
internal/requestconfig/requestconfig.go:854
↓ 5 callersMethodCancel
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 callersMethodCreateRoot
()
lib/environments/memories.go:185
↓ 5 callersMethodErr
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 callersMethodError
()
lib/environments/memories.go:163
↓ 5 callersMethodEvent
()
packages/ssestream/ssestream.go:17
↓ 5 callersMethodExecute
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 callersMethodGetType
Returns a pointer to the underlying variant's property, if present.
betaagent.go:6601
↓ 5 callersMethodHashFile
(rel string)
lib/environments/memories.go:183
↓ 5 callersMethodHeartbeat
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 callersMethodIndex
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 callersFunctionNewBetaCacheControlEphemeralParam
()
betamessage.go:5739
↓ 5 callersFunctionNewBetaToolFromBytes
NewBetaToolFromBytes creates a BetaTool from JSON schema bytes.
toolrunner/tool.go:80
↓ 5 callersFunctionNewEnvironmentWorker
NewEnvironmentWorker returns an [EnvironmentWorker] bound to client. Call [EnvironmentWorker.Run] to start polling.
lib/environments/worker.go:161
↓ 5 callersFunctionNewStream
(decoder Decoder, err error)
packages/ssestream/ssestream.go:217
↓ 5 callersFunctionNewWorkPoller
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 callersMethodNext
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 callersFunctionOpen
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 callersMethodReadOnlyRoots
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 callersFunctionSetErrorStatus
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 callersFunctionWith
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 callersFunctionWithFederationTokenProvider
WithFederationTokenProvider returns a [RequestOption] that authenticates requests using workload identity federation, exchanging a caller-supplied ide
option/requestoption.go:123
↓ 5 callersFunctionWithGoogleAuth
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 callersFunctionWithOpenTelemetryTracesMaxContentBytes
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 callersFunctionWithProfile
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 callersFunctionas
(credential string)
environmentworker_properties_test.go:360
↓ 5 callersMethodasAny
()
message.go:10703
↓ 5 callersFunctionassistantMessage
(text string)
betamessagethreadutil_test.go:174
↓ 5 callersMethodattachMemory
(files map[string]string, mountPath, access string)
environmentworker_fake_test.go:292
↓ 5 callersFunctionattributeValues
(attrs []attribute.KeyValue)
internal/tracing/attributes_test.go:19
↓ 5 callersFunctionbedrockMiddleware
(signer *v4.Signer, cfg aws.Config)
bedrock/bedrock.go:322
↓ 5 callersFunctionbetaThreadJSON
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 callersFunctioncalledTool
(message *BetaMessage)
betatoolrunner_test.go:442
↓ 5 callersFunctioncancelOnFile
(t *testing.T, path string)
tools/agenttoolset/bash_test.go:42
↓ 5 callersFunctioncanonicalize
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 callersFunctioncaptureStderr
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 callersMethodcheck
(holds bool, violation string, args ...any)
environmentworker_properties_test.go:138
↓ 5 callersFunctioncolorWith
(code string, s string)
examples/tool-runner-streaming/main.go:18
↓ 5 callersFunctioncompactOnToolUse
(runner *turnRunner)
betatoolrunner_test.go:1620
↓ 5 callersFunctionconcurrent
(limit int)
betasessiontoolrunner_test.go:117
↓ 5 callersFunctioncredentialOptions
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 callersFunctiondefinitionName
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 callersFunctiondoing
(action workerAction)
environmentworker_properties_test.go:364
↓ 5 callersMethodemitEarlyEndTurn
emitEarlyEndTurn makes the session's status say that the turn ended, though the subagent has not finished.
betasessiontoolrunner_fake_test.go:645
↓ 5 callersFunctionencodeChunkFrame
--- EventStream → SSE response normalization tests --- encodeChunkFrame writes an EventStream "chunk" event frame whose payload carries the given Anth
bedrock/bedrock_test.go:635
↓ 5 callersMethodendTurnWith
(thread, stopReason string)
betasessiontoolrunner_fake_test.go:635
↓ 5 callersMethodeof
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 callersFunctionexecGrep
(ctx context.Context, raw json.RawMessage, env *AgentToolContext)
tools/agenttoolset/search.go:213
↓ 5 callersMethodfail
(method string)
opentelemetry_test.go:1710
← previousnext →501–600 of 17,396, ranked by callers