MCPcopy Create free account

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

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

↓ 47 callersFunctionwriteLocal
(t *testing.T, dir, name, content string)
lib/environments/memories_test.go:573
↓ 46 callersMethodWrite
(p []byte)
tools/agenttoolset/search.go:311
↓ 46 callersFunctionuserMessage
(text string)
betamessagethreadutil_test.go:165
↓ 45 callersMethodCurrent
()
betatoolrunner.go:846
↓ 44 callersFunctionWithMiddleware
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 callersFunctionfallbackTestClient
(t *testing.T, responses []string, middleware option.Middleware)
lib/betafallback/betafallback_test.go:114
↓ 43 callersMethodString
()
internal/encoding/json/stream.go:356
↓ 43 callersFunctionrequireMessages
(t *testing.T, messages []BetaMessageParam, want string)
betamessagethreadutil_test.go:331
↓ 42 callersMethodRunToCompletion
RunToCompletion repeatedly calls NextMessage until the conversation is complete, either because the model stopped using tools or the maximum iteration
betatoolrunner.go:1028
↓ 40 callersFunctionmessageResponse
(model string)
lib/betafallback/betafallback_test.go:88
↓ 40 callersFunctionrefusalResponse
(model string, creditToken any)
lib/betafallback/betafallback_test.go:103
↓ 40 callersMethodstarted
()
environmentworker_fake_test.go:130
↓ 38 callersMethodfail
(method string)
client_test.go:1234
↓ 38 callersFunctionnewBashTool
(t *testing.T, dir string)
tools/agenttoolset/bash_test.go:24
↓ 38 callersMethodrequireAction
otherIDs are ids of no tool call.
betasessiontoolrunner_fake_test.go:550
↓ 37 callersMethodSpans
Spans returns the spans that have ended, in the order they ended.
opentelemetry_test.go:88
↓ 37 callersMethodstartTurn
startTurn stages the messages of a turn and marks the turn as in progress.
betamessagethreadutil.go:267
↓ 37 callersFunctionweatherCall
weatherCall is a reply msg_<id> that calls the weather tool with call id.
betatoolrunnerthread_test.go:27
↓ 36 callersFunctionLoadConfig
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 callersFunctionclearEnv
(t *testing.T)
googlecloud/googlecloud_test.go:22
↓ 36 callersMethodcloseStream
closeStream ends the streams with eof, error (an error frame) or reset.
betasessiontoolrunner_fake_test.go:823
↓ 36 callersFunctionisolateAuthEnv
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 callersMethodterminate
()
betasessiontoolrunner_fake_test.go:752
↓ 36 callersFunctionunsetEnv
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 callersMethodOr
(v T)
packages/param/option.go:44
↓ 35 callersFunctionfilter
(in []T, keep func(T) bool)
betasessiontoolrunner_fake_test.go:153
↓ 34 callersMethodSend
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 callersMethodAppend
Append stages messages for the next turn without sending them.
betamessagethreadutil.go:159
↓ 33 callersMethodError
()
internal/auth/error.go:48
↓ 33 callersFunctionNewOpt
(v T)
packages/param/option.go:10
↓ 33 callersFunctionnewTestToolRunnerClient
(server *httptest.Server)
betatoolrunner_test.go:73
↓ 33 callersFunctionrequireTimes
(t *testing.T, want []timeRange, got []float64)
betasessiontoolrunner_test.go:97
↓ 33 callersFunctionthreadRunnerParams
()
betatoolrunnerthread_test.go:17
↓ 32 callersMethodinterrupt
()
betasessiontoolrunner_fake_test.go:699
↓ 32 callersFunctionrunPoller
(t *testing.T, steps schedule, opts pollerOptions)
environmentworker_fake_test.go:817
↓ 32 callersMethodrunning
(thread string)
betasessiontoolrunner_fake_test.go:500
↓ 31 callersMethodact
(name string, action func(*fakeSession), args ...any)
betasessiontoolrunner_fake_test.go:488
↓ 30 callersFunctionWithConservativeRetries
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 callersFunctiontoolRunnerParams
()
opentelemetry_toolrunner_test.go:102
↓ 30 callersFunctionweatherResultJSON
(id string)
betatoolrunnerthread_test.go:35
↓ 29 callersMethodDecode
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 callersMethodRawJSON
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 callersFunctionWithConfig
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 callersMethodendTurn
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 callersFunctionwantJSON
wantJSON checks that the attribute key of span holds the JSON value want.
opentelemetry_test.go:162
↓ 27 callersMethodArchive
Archive Agent
betaagent.go:166
↓ 27 callersMethodNewToolRunnerStreaming
NewToolRunnerStreaming creates a [BetaToolRunnerStreaming] over this thread like [BetaMessageThread.NewToolRunner].
betatoolrunner.go:212
↓ 27 callersMethodPreviousMessageID
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 callersFunctionattached
(notes string)
environmentworker_test.go:1003
↓ 27 callersFunctionscriptedMessagesServer
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 callersFunctionstreamingFallbackClient
(t *testing.T, transport *sseTransport, fallbacks []anthropic.BetaFallbackParam)
lib/betafallback/streaming_test.go:98
↓ 26 callersFunctionattr
(span sdktrace.ReadOnlySpan, key string)
opentelemetry_test.go:93
↓ 26 callersMethodkinds
()
environmentworker_fake_test.go:146
↓ 26 callersFunctionnewThreadRunner
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 callersFunctionnotesIn
(t *testing.T)
environmentworker_test.go:1007
↓ 25 callersMethodAsString
()
message.go:1101
↓ 25 callersMethodCompactBeforeNextTurn
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 callersMethodExecute
Execute runs the tool with raw JSON input and returns one or more result blocks.
betatoolrunner.go:35
↓ 25 callersFunctionsendOrStream
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 callersMethodIsZero
()
internal/encoding/json/encode.go:1132
↓ 24 callersFunctionaround
(times ...float64)
workpoller_test.go:45
↓ 24 callersFunctioncollectStream
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 callersMethoderror
error records an error and switches to the error state.
internal/encoding/json/scanner.go:591
↓ 24 callersFunctionnewSpanRecorder
()
opentelemetry_test.go:77
↓ 24 callersMethodnow
()
environmentworker_fake_test.go:212
↓ 24 callersFunctiononeOf
(value string, options ...string)
betasessiontoolrunner_fake_test.go:512
↓ 24 callersMethodtextsSent
(id string)
betasessiontoolrunner_fake_test.go:201
↓ 24 callersFunctiontoolRunnerTransport
toolRunnerTransport answers the first request with tool calls, and the next with a final message.
opentelemetry_toolrunner_test.go:59
↓ 24 callersMethodwith
(configure func(*workerConfig))
environmentworker_test.go:82
↓ 23 callersFunctionWithTracerProvider
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 callersFunctionnewStore
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 callersFunctionpauseTurnParams
(maxIterations int)
betatoolrunner_test.go:1417
↓ 23 callersFunctionrequireEnabled
requireEnabled ends the action, before it changes anything, if the API cannot take it in this state.
betasessiontoolrunner_fake_test.go:482
↓ 23 callersFunctionrunBash
(t *testing.T, tool anthropic.BetaTool, command string)
tools/agenttoolset/bash_test.go:35
↓ 22 callersMethodNewThread
NewThread creates a [BetaMessageThread] and sends no request. params holds what [BetaMessageService.New] takes, except Thread.
betamessagethreadutil.go:112
↓ 22 callersFunctionnewTurnRunner
(client Client, stream bool, tools []BetaTool, params BetaToolRunnerParams)
betatoolrunner_test.go:1575
↓ 22 callersFunctionput
(t *testing.T, store *FileStore, rel, data string)
internal/filestore/filestore_test.go:53
↓ 22 callersFunctionsetupConfigDir
setupConfigDir creates a temp config dir with configs/<profile>.json written from cfgData. Returns the config dir path.
config/config_test.go:18
↓ 22 callersFunctionupdated
(path, content, was string)
lib/environments/memories_test.go:55
↓ 22 callersMethodyielded
(f *fakeSession, call anthropic.DispatchedToolCall)
betasessiontoolrunner_fake_test.go:1411
↓ 21 callersMethodAsAny
Use the following switch statement to find the correct variant switch variant := BetaErrorObjectUnion.AsAny().(type) { case anthropic.BetaInvalidRe
beta.go:277
↓ 21 callersFunctionResolveCredentials
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 callersMethodString
()
internal/auth/test_helpers_test.go:21
↓ 21 callersFunctionToOpt
(v T, meta respjson.Field)
internal/paramutil/field.go:15
↓ 21 callersFunctionWithConfig
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 callersMethodcancel
(client string)
environmentworker_fake_test.go:311
↓ 21 callersFunctionidleFor
(s float64)
betasessiontoolrunner_test.go:113
↓ 21 callersMethodlose
(appends int)
betasessiontoolrunner_fake_test.go:793
↓ 21 callersFunctiononlyCall
(t *testing.T, trace *sessionTrace)
betasessiontoolrunner_test.go:142
↓ 21 callersMethodprocessInput
processInput moves one pending input to the log under the same id.
betasessiontoolrunner_fake_test.go:577
↓ 21 callersFunctionservedStream
(model string)
lib/betafallback/streaming_test.go:85
↓ 21 callersFunctionweatherCallJSON
(id string)
betatoolrunnerthread_test.go:31
↓ 20 callersMethodLastMessage
LastMessage returns the most recent assistant message, or nil if no messages have been received yet.
betatoolrunner.go:294
↓ 20 callersMethodWrite
(path, content string)
lib/environments/memories_test.go:130
↓ 20 callersFunctionrequireRequestCount
(t *testing.T, bodies [][]byte, want int)
betatoolrunner_test.go:1667
↓ 19 callersMethodToParam
ToParam converters
messageutil.go:195
↓ 19 callersMethodconfirm
(id, result string)
betasessiontoolrunner_fake_test.go:680
↓ 19 callersFunctionnewRunnerOverThread
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 callersMethodstartedAt
()
betasessiontoolrunner_fake_test.go:163
↓ 19 callersMethodterminateThread
()
betasessiontoolrunner_fake_test.go:732
← previousnext →101–200 of 17,396, ranked by callers