Documentation
¶
Index ¶
- func IsBadRequest(err error) bool
- func IsConflict(err error) bool
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func NormalizeURL(apiURL string) string
- type Client
- func (c *Client) APIKey() string
- func (c *Client) APIURL() string
- func (c *Client) FetchCustomAppSource(ctx context.Context, appID string) ([]byte, error)
- func (c *Client) OAuthAccessToken() string
- func (c *Client) RawDelete(ctx context.Context, path string, result any) error
- func (c *Client) RawDo(ctx context.Context, method, path string, body io.Reader, ...) (statusCode int, proto string, respHeaders http.Header, respBody []byte, ...)
- func (c *Client) RawGet(ctx context.Context, path string, result any) error
- func (c *Client) RawPatch(ctx context.Context, path string, body any, result any) error
- func (c *Client) RawPost(ctx context.Context, path string, body any, result any) error
- func (c *Client) ResolveSessionID(ctx context.Context, projectName string) (string, error)
- func (c *Client) UseV2API(ctx context.Context) (bool, error)
- type CustomAppRequest
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBadRequest ¶ added in v0.2.43
func IsConflict ¶ added in v0.2.41
func IsForbidden ¶ added in v0.2.42
func IsNotFound ¶ added in v0.2.41
func NormalizeURL ¶ added in v0.1.7
NormalizeURL strips a trailing "/api/v1" suffix (with or without a trailing slash) so that the SDK — which appends "api/v1" itself — does not double it. Self-hosted users commonly set LANGSMITH_ENDPOINT to "https://host/api/v1".
Types ¶
type Client ¶
Client wraps the LangSmith Go SDK and provides helpers for raw HTTP calls.
func NewWithOptions ¶ added in v0.2.26
NewWithOptions creates a new Client from resolved options.
func (*Client) FetchCustomAppSource ¶ added in v0.2.43
FetchCustomAppSource returns the stored .tar.gz bytes for a custom app. The response is binary, so it bypasses the JSON-decoding raw helpers.
func (*Client) OAuthAccessToken ¶ added in v0.2.26
OAuthAccessToken returns the client's OAuth access token.
func (*Client) RawDo ¶ added in v0.2.15
func (c *Client) RawDo(ctx context.Context, method, path string, body io.Reader, extraHeaders http.Header) (statusCode int, proto string, respHeaders http.Header, respBody []byte, err error)
RawDo performs an arbitrary HTTP request and returns the raw response. Unlike RawGet/RawPost/RawDelete, it does not unmarshal the response and does not treat 4xx/5xx as errors — callers decide how to handle status codes. body may be nil. extraHeaders are merged on top of the default auth headers.
func (*Client) ResolveSessionID ¶
ResolveSessionID resolves a project name to its session UUID, with caching.
type CustomAppRequest ¶ added in v0.2.43
type CustomAppRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Files map[string]string `json:"files,omitempty"`
Entrypoint *string `json:"entrypoint,omitempty"`
SourceArchive *string `json:"source_archive,omitempty"`
}
CustomAppRequest is the body of custom-app create (POST) and update (PATCH). Unset pointer fields are omitted, leaving the server value untouched.