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
↓ 47 callers
Function
writeLocal
(t *testing.T, dir, name, content string)
lib/environments/memories_test.go:573
↓ 46 callers
Method
Write
(p []byte)
tools/agenttoolset/search.go:311
↓ 46 callers
Function
userMessage
(text string)
betamessagethreadutil_test.go:165
↓ 45 callers
Method
Current
()
betatoolrunner.go:846
↓ 44 callers
Function
WithMiddleware
WithMiddleware returns a RequestOption that applies the given middleware to the requests made. Each middleware will execute in the order they were giv
option/requestoption.go:215
↓ 44 callers
Function
fallbackTestClient
(t *testing.T, responses []string, middleware option.Middleware)
lib/betafallback/betafallback_test.go:114
↓ 43 callers
Method
String
()
internal/encoding/json/stream.go:356
↓ 43 callers
Function
requireMessages
(t *testing.T, messages []BetaMessageParam, want string)
betamessagethreadutil_test.go:331
↓ 42 callers
Method
RunToCompletion
RunToCompletion repeatedly calls NextMessage until the conversation is complete, either because the model stopped using tools or the maximum iteration
betatoolrunner.go:1028
↓ 40 callers
Function
messageResponse
(model string)
lib/betafallback/betafallback_test.go:88
↓ 40 callers
Function
refusalResponse
(model string, creditToken any)
lib/betafallback/betafallback_test.go:103
↓ 40 callers
Method
started
()
environmentworker_fake_test.go:130
↓ 38 callers
Method
fail
(method string)
client_test.go:1234
↓ 38 callers
Function
newBashTool
(t *testing.T, dir string)
tools/agenttoolset/bash_test.go:24
↓ 38 callers
Method
requireAction
otherIDs are ids of no tool call.
betasessiontoolrunner_fake_test.go:550
↓ 37 callers
Method
Spans
Spans returns the spans that have ended, in the order they ended.
opentelemetry_test.go:88
↓ 37 callers
Method
startTurn
startTurn stages the messages of a turn and marks the turn as in progress.
betamessagethreadutil.go:267
↓ 37 callers
Function
weatherCall
weatherCall is a reply msg_<id> that calls the weather tool with call id.
betatoolrunnerthread_test.go:27
↓ 36 callers
Function
LoadConfig
LoadConfig reads the raw configuration from the Anthropic config file system (configs/<profile>.json) and returns it without resolving credentials. Cr
config/config.go:581
↓ 36 callers
Function
clearEnv
(t *testing.T)
googlecloud/googlecloud_test.go:22
↓ 36 callers
Method
closeStream
closeStream ends the streams with eof, error (an error frame) or reset.
betasessiontoolrunner_fake_test.go:823
↓ 36 callers
Function
isolateAuthEnv
isolateAuthEnv points ANTHROPIC_CONFIG_DIR at a fresh temp dir and unsets ANTHROPIC_BASE_URL and the federation env vars so a test is not affected by
internal/auth/integration_test.go:37
↓ 36 callers
Method
terminate
()
betasessiontoolrunner_fake_test.go:752
↓ 36 callers
Function
unsetEnv
unsetEnv removes an env var for the duration of the test. t.Setenv registers the original value for restore at test end; Unsetenv then actually remove
internal/auth/integration_test.go:28
↓ 35 callers
Method
Or
(v T)
packages/param/option.go:44
↓ 35 callers
Function
filter
(in []T, keep func(T) bool)
betasessiontoolrunner_fake_test.go:153
↓ 34 callers
Method
Send
Send sends the staged messages and params.Messages as one turn and returns the reply. params and opts apply to this turn only. It returns an error whi
betamessagethreadutil.go:220
↓ 33 callers
Method
Append
Append stages messages for the next turn without sending them.
betamessagethreadutil.go:159
↓ 33 callers
Method
Error
()
internal/auth/error.go:48
↓ 33 callers
Function
NewOpt
(v T)
packages/param/option.go:10
↓ 33 callers
Function
newTestToolRunnerClient
(server *httptest.Server)
betatoolrunner_test.go:73
↓ 33 callers
Function
requireTimes
(t *testing.T, want []timeRange, got []float64)
betasessiontoolrunner_test.go:97
↓ 33 callers
Function
threadRunnerParams
()
betatoolrunnerthread_test.go:17
↓ 32 callers
Method
interrupt
()
betasessiontoolrunner_fake_test.go:699
↓ 32 callers
Function
runPoller
(t *testing.T, steps schedule, opts pollerOptions)
environmentworker_fake_test.go:817
↓ 32 callers
Method
running
(thread string)
betasessiontoolrunner_fake_test.go:500
↓ 31 callers
Method
act
(name string, action func(*fakeSession), args ...any)
betasessiontoolrunner_fake_test.go:488
↓ 30 callers
Function
WithConservativeRetries
WithConservativeRetries retries a request only when the API can't have processed it, meaning a 429 response or a connection that never opened. Methods
internal/requestconfig/requestconfig.go:806
↓ 30 callers
Function
toolRunnerParams
()
opentelemetry_toolrunner_test.go:102
↓ 30 callers
Function
weatherResultJSON
(id string)
betatoolrunnerthread_test.go:35
↓ 29 callers
Method
Decode
Decode reads the next JSON-encoded value from its input and stores it in the value pointed to by v. See the documentation for [Unmarshal] for details
internal/encoding/json/stream.go:48
↓ 29 callers
Method
RawJSON
RawJSON returns the JSON of the Message as the events have built it so far, as the API would have sent it unstreamed. It is whole once message_stop wa
internal/telemetry/stream.go:38
↓ 28 callers
Function
WithConfig
WithConfig returns a [RequestOption] that authenticates requests using the given [config.Config]. Credentials are resolved on the first request, so a
option/requestoption.go:421
↓ 28 callers
Method
endTurn
endTurn marks the turn in progress as ended. A turn that was not recorded takes back the messages it was given.
betamessagethreadutil.go:290
↓ 28 callers
Function
wantJSON
wantJSON checks that the attribute key of span holds the JSON value want.
opentelemetry_test.go:162
↓ 27 callers
Method
Archive
Archive Agent
betaagent.go:166
↓ 27 callers
Method
NewToolRunnerStreaming
NewToolRunnerStreaming creates a [BetaToolRunnerStreaming] over this thread like [BetaMessageThread.NewToolRunner].
betatoolrunner.go:212
↓ 27 callers
Method
PreviousMessageID
PreviousMessageID returns the ID of the reply that the next turn continues from, or "" when the next turn starts a new thread.
betamessagethreadutil.go:138
↓ 27 callers
Function
attached
(notes string)
environmentworker_test.go:1003
↓ 27 callers
Function
scriptedMessagesServer
scriptedMessagesServer answers POST /v1/messages with the scripted message bodies in order (as SSE when the request sets "stream") and records every r
betatoolrunner_test.go:1337
↓ 27 callers
Function
streamingFallbackClient
(t *testing.T, transport *sseTransport, fallbacks []anthropic.BetaFallbackParam)
lib/betafallback/streaming_test.go:98
↓ 26 callers
Function
attr
(span sdktrace.ReadOnlySpan, key string)
opentelemetry_test.go:93
↓ 26 callers
Method
kinds
()
environmentworker_fake_test.go:146
↓ 26 callers
Function
newThreadRunner
newThreadRunner returns a runner with the weather tool, which counts its runs, on a client of a server that answers with script.
betatoolrunnerthread_test.go:45
↓ 26 callers
Function
notesIn
(t *testing.T)
environmentworker_test.go:1007
↓ 25 callers
Method
AsString
()
message.go:1101
↓ 25 callers
Method
CompactBeforeNextTurn
CompactBeforeNextTurn compacts the conversation before the model's next turn. Once the current turn has finished, including any tool calls, the runner
betatoolrunner.go:318
↓ 25 callers
Method
Execute
Execute runs the tool with raw JSON input and returns one or more result blocks.
betatoolrunner.go:35
↓ 25 callers
Function
sendOrStream
sendOrStream sends a turn, as a stream that is read to its end when stream is set, and returns how the turn ended.
betamessagethreadutil_test.go:371
↓ 24 callers
Method
IsZero
()
internal/encoding/json/encode.go:1132
↓ 24 callers
Function
around
(times ...float64)
workpoller_test.go:45
↓ 24 callers
Function
collectStream
collectStream drains a streaming call, returning the accumulated message, the (type, index) sequence, and each message_delta's raw JSON.
lib/betafallback/streaming_test.go:110
↓ 24 callers
Method
error
error records an error and switches to the error state.
internal/encoding/json/scanner.go:591
↓ 24 callers
Function
newSpanRecorder
()
opentelemetry_test.go:77
↓ 24 callers
Method
now
()
environmentworker_fake_test.go:212
↓ 24 callers
Function
oneOf
(value string, options ...string)
betasessiontoolrunner_fake_test.go:512
↓ 24 callers
Method
textsSent
(id string)
betasessiontoolrunner_fake_test.go:201
↓ 24 callers
Function
toolRunnerTransport
toolRunnerTransport answers the first request with tool calls, and the next with a final message.
opentelemetry_toolrunner_test.go:59
↓ 24 callers
Method
with
(configure func(*workerConfig))
environmentworker_test.go:82
↓ 23 callers
Function
WithTracerProvider
The OpenTelemetry options configure the span of each API call. They are client options: pass them to the client. Like every RequestOption, one that is
option/tracing.go:17
↓ 23 callers
Function
newStore
newStore opens a FileStore on a fresh root, creates the root, and returns the store with the root path.
internal/filestore/filestore_test.go:47
↓ 23 callers
Function
pauseTurnParams
(maxIterations int)
betatoolrunner_test.go:1417
↓ 23 callers
Function
requireEnabled
requireEnabled ends the action, before it changes anything, if the API cannot take it in this state.
betasessiontoolrunner_fake_test.go:482
↓ 23 callers
Function
runBash
(t *testing.T, tool anthropic.BetaTool, command string)
tools/agenttoolset/bash_test.go:35
↓ 22 callers
Method
NewThread
NewThread creates a [BetaMessageThread] and sends no request. params holds what [BetaMessageService.New] takes, except Thread.
betamessagethreadutil.go:112
↓ 22 callers
Function
newTurnRunner
(client Client, stream bool, tools []BetaTool, params BetaToolRunnerParams)
betatoolrunner_test.go:1575
↓ 22 callers
Function
put
(t *testing.T, store *FileStore, rel, data string)
internal/filestore/filestore_test.go:53
↓ 22 callers
Function
setupConfigDir
setupConfigDir creates a temp config dir with configs/<profile>.json written from cfgData. Returns the config dir path.
config/config_test.go:18
↓ 22 callers
Function
updated
(path, content, was string)
lib/environments/memories_test.go:55
↓ 22 callers
Method
yielded
(f *fakeSession, call anthropic.DispatchedToolCall)
betasessiontoolrunner_fake_test.go:1411
↓ 21 callers
Method
AsAny
Use the following switch statement to find the correct variant switch variant := BetaErrorObjectUnion.AsAny().(type) { case anthropic.BetaInvalidRe
beta.go:277
↓ 21 callers
Function
ResolveCredentials
ResolveCredentials builds a [CredentialsResult] from a [config.Config]. The [AuthenticationInfo.CredentialsPath] must already be resolved to an absolu
internal/auth/credentials_file.go:87
↓ 21 callers
Method
String
()
internal/auth/test_helpers_test.go:21
↓ 21 callers
Function
ToOpt
(v T, meta respjson.Field)
internal/paramutil/field.go:15
↓ 21 callers
Function
WithConfig
WithConfig returns a request option that uses the provided config and registers middleware to intercept requests to the Messages API, enabling this SD
bedrock/bedrock.go:269
↓ 21 callers
Method
cancel
(client string)
environmentworker_fake_test.go:311
↓ 21 callers
Function
idleFor
(s float64)
betasessiontoolrunner_test.go:113
↓ 21 callers
Method
lose
(appends int)
betasessiontoolrunner_fake_test.go:793
↓ 21 callers
Function
onlyCall
(t *testing.T, trace *sessionTrace)
betasessiontoolrunner_test.go:142
↓ 21 callers
Method
processInput
processInput moves one pending input to the log under the same id.
betasessiontoolrunner_fake_test.go:577
↓ 21 callers
Function
servedStream
(model string)
lib/betafallback/streaming_test.go:85
↓ 21 callers
Function
weatherCallJSON
(id string)
betatoolrunnerthread_test.go:31
↓ 20 callers
Method
LastMessage
LastMessage returns the most recent assistant message, or nil if no messages have been received yet.
betatoolrunner.go:294
↓ 20 callers
Method
Write
(path, content string)
lib/environments/memories_test.go:130
↓ 20 callers
Function
requireRequestCount
(t *testing.T, bodies [][]byte, want int)
betatoolrunner_test.go:1667
↓ 19 callers
Method
ToParam
ToParam converters
messageutil.go:195
↓ 19 callers
Method
confirm
(id, result string)
betasessiontoolrunner_fake_test.go:680
↓ 19 callers
Function
newRunnerOverThread
newRunnerOverThread returns a thread that was created with the weather tool, has sent one turn and has a question staged, and a runner with the tool o
betatoolrunnerthread_test.go:682
↓ 19 callers
Method
startedAt
()
betasessiontoolrunner_fake_test.go:163
↓ 19 callers
Method
terminateThread
()
betasessiontoolrunner_fake_test.go:732
← previous
next →
101–200 of 17,396, ranked by callers