Documentation
¶
Index ¶
- Constants
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type ActionAddReactionParams
- type ActionAddReactionParamsProvider
- type ActionAddReactionResponse
- type ActionSendMessageParams
- type ActionSendMessageParamsProvider
- type ActionSendMessageResponse
- type ActionService
- type AuthDeleteUserResponse
- type AuthMeResponse
- type AuthMeResponseApp
- type AuthService
- func (r *AuthService) DeleteUser(ctx context.Context, opts ...option.RequestOption) (res *AuthDeleteUserResponse, err error)
- func (r *AuthService) Me(ctx context.Context, opts ...option.RequestOption) (res *AuthMeResponse, err error)
- func (r *AuthService) UserToken(ctx context.Context, body AuthUserTokenParams, opts ...option.RequestOption) (res *Token, err error)
- type AuthUserTokenParams
- type Calendar
- type CalendarItem
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ConnectionListResponse
- type ConnectionListResponseConnection
- type ConnectionRevokeResponse
- type ConnectionService
- type Error
- type EvaluateScoreHighlightParams
- type EvaluateScoreHighlightResponse
- type EvaluateScoreQueryParams
- type EvaluateScoreQueryResponse
- type EvaluateService
- func (r *EvaluateService) GetQuery(ctx context.Context, queryID string, opts ...option.RequestOption) (res *shared.QueryResult, err error)
- func (r *EvaluateService) ScoreHighlight(ctx context.Context, highlightID string, body EvaluateScoreHighlightParams, ...) (res *EvaluateScoreHighlightResponse, err error)
- func (r *EvaluateService) ScoreQuery(ctx context.Context, queryID string, body EvaluateScoreQueryParams, ...) (res *EvaluateScoreQueryResponse, err error)
- type FolderDeletePolicyParams
- type FolderDeletePolicyResponse
- type FolderListParams
- type FolderListPoliciesResponse
- type FolderListPoliciesResponsePolicy
- type FolderListResponse
- type FolderListResponseFolder
- type FolderListResponseFolderPolicy
- type FolderService
- func (r *FolderService) DeletePolicy(ctx context.Context, policyID string, body FolderDeletePolicyParams, ...) (res *FolderDeletePolicyResponse, err error)
- func (r *FolderService) List(ctx context.Context, connectionID string, query FolderListParams, ...) (res *FolderListResponse, err error)
- func (r *FolderService) ListPolicies(ctx context.Context, connectionID string, opts ...option.RequestOption) (res *FolderListPoliciesResponse, err error)
- func (r *FolderService) SetPolicies(ctx context.Context, connectionID string, body FolderSetPoliciesParams, ...) (res *FolderSetPoliciesResponse, err error)
- type FolderSetPoliciesParams
- type FolderSetPoliciesParamsSyncMode
- type FolderSetPoliciesResponse
- type FolderSetPoliciesResponseSyncMode
- type IntegrationConnectParams
- type IntegrationConnectResponse
- type IntegrationGoogleCalendarService
- type IntegrationListResponse
- type IntegrationListResponseIntegration
- type IntegrationService
- type IntegrationSlackListParams
- type IntegrationSlackListResponse
- type IntegrationSlackService
- type IntegrationWebCrawlerIndexParams
- type IntegrationWebCrawlerIndexResponse
- type IntegrationWebCrawlerIndexResponseSource
- type IntegrationWebCrawlerIndexResponseStatus
- type IntegrationWebCrawlerService
- type Memory
- type MemoryAddBulkParams
- type MemoryAddBulkParamsItem
- type MemoryAddBulkParamsItemMetadataUnion
- type MemoryAddBulkResponse
- type MemoryAddParams
- type MemoryAddParamsMetadataUnion
- type MemoryDeleteParams
- type MemoryDeleteParamsSource
- type MemoryDeleteResponse
- type MemoryDeleteResponseSource
- type MemoryGetParams
- type MemoryGetParamsSource
- type MemoryListParams
- type MemoryListParamsSource
- type MemoryListParamsStatus
- type MemorySearchParams
- type MemorySearchParamsOptions
- type MemorySearchParamsOptionsBox
- type MemorySearchParamsOptionsGoogleCalendar
- type MemorySearchParamsOptionsGoogleDrive
- type MemorySearchParamsOptionsGoogleMail
- type MemorySearchParamsOptionsNotion
- type MemorySearchParamsOptionsReddit
- type MemorySearchParamsOptionsSlack
- type MemorySearchParamsOptionsVault
- type MemorySearchParamsOptionsWebCrawler
- type MemoryService
- func (r *MemoryService) Add(ctx context.Context, body MemoryAddParams, opts ...option.RequestOption) (res *MemoryStatus, err error)
- func (r *MemoryService) AddBulk(ctx context.Context, body MemoryAddBulkParams, opts ...option.RequestOption) (res *MemoryAddBulkResponse, err error)
- func (r *MemoryService) Delete(ctx context.Context, resourceID string, body MemoryDeleteParams, ...) (res *MemoryDeleteResponse, err error)
- func (r *MemoryService) Get(ctx context.Context, resourceID string, query MemoryGetParams, ...) (res *Memory, err error)
- func (r *MemoryService) List(ctx context.Context, query MemoryListParams, opts ...option.RequestOption) (res *pagination.CursorPage[shared.Resource], err error)
- func (r *MemoryService) ListAutoPaging(ctx context.Context, query MemoryListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[shared.Resource]
- func (r *MemoryService) Search(ctx context.Context, body MemorySearchParams, opts ...option.RequestOption) (res *shared.QueryResult, err error)
- func (r *MemoryService) Status(ctx context.Context, opts ...option.RequestOption) (res *MemoryStatusResponse, err error)
- func (r *MemoryService) Update(ctx context.Context, resourceID string, params MemoryUpdateParams, ...) (res *MemoryStatus, err error)
- func (r *MemoryService) Upload(ctx context.Context, body MemoryUploadParams, opts ...option.RequestOption) (res *MemoryStatus, err error)
- type MemorySource
- type MemoryStatus
- type MemoryStatusResponse
- type MemoryStatusSource
- type MemoryStatusStatus
- type MemoryUpdateParams
- type MemoryUpdateParamsMetadataUnion
- type MemoryUpdateParamsSource
- type MemoryUploadParams
- type Metadata
- type MetadataStatus
- type Notification
- type NotificationType
- type QueryResult
- type Resource
- type ResourceSource
- type SessionAddParams
- type SessionAddParamsFormat
- type SessionAddParamsMetadataUnion
- type SessionService
- type Token
- type VaultListParams
- type VaultListResponse
- type VaultService
- func (r *VaultService) List(ctx context.Context, query VaultListParams, opts ...option.RequestOption) (res *pagination.CursorPage[VaultListResponse], err error)deprecated
- func (r *VaultService) ListAutoPaging(ctx context.Context, query VaultListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[VaultListResponse]deprecated
Constants ¶
const MetadataStatusCompleted = shared.MetadataStatusCompleted
Equals "completed"
const MetadataStatusFailed = shared.MetadataStatusFailed
Equals "failed"
const MetadataStatusPending = shared.MetadataStatusPending
Equals "pending"
const MetadataStatusPendingReview = shared.MetadataStatusPendingReview
Equals "pending_review"
const MetadataStatusProcessing = shared.MetadataStatusProcessing
Equals "processing"
const MetadataStatusSkipped = shared.MetadataStatusSkipped
Equals "skipped"
const NotificationTypeError = shared.NotificationTypeError
Equals "error"
const NotificationTypeInfo = shared.NotificationTypeInfo
Equals "info"
const NotificationTypeSuccess = shared.NotificationTypeSuccess
Equals "success"
const NotificationTypeWarning = shared.NotificationTypeWarning
Equals "warning"
const ResourceSourceBox = shared.ResourceSourceBox
Equals "box"
const ResourceSourceDropbox = shared.ResourceSourceDropbox
Equals "dropbox"
const ResourceSourceGitHub = shared.ResourceSourceGitHub
Equals "github"
const ResourceSourceGmailActions = shared.ResourceSourceGmailActions
Equals "gmail_actions"
const ResourceSourceGoogleCalendar = shared.ResourceSourceGoogleCalendar
Equals "google_calendar"
const ResourceSourceGoogleDrive = shared.ResourceSourceGoogleDrive
Equals "google_drive"
const ResourceSourceGoogleMail = shared.ResourceSourceGoogleMail
Equals "google_mail"
const ResourceSourceMicrosoftTeams = shared.ResourceSourceMicrosoftTeams
Equals "microsoft_teams"
const ResourceSourceNotion = shared.ResourceSourceNotion
Equals "notion"
const ResourceSourceReddit = shared.ResourceSourceReddit
Equals "reddit"
const ResourceSourceSlack = shared.ResourceSourceSlack
Equals "slack"
const ResourceSourceTrace = shared.ResourceSourceTrace
Equals "trace"
const ResourceSourceVault = shared.ResourceSourceVault
Equals "vault"
const ResourceSourceWebCrawler = shared.ResourceSourceWebCrawler
Equals "web_crawler"
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (HYPERSPELL_API_KEY, HYPERSPELL_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type ActionAddReactionParams ¶
type ActionAddReactionParams struct {
// Channel ID containing the message
Channel string `json:"channel" api:"required"`
// Emoji name without colons (e.g., thumbsup)
Name string `json:"name" api:"required"`
// Integration provider (e.g., slack)
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Provider ActionAddReactionParamsProvider `json:"provider,omitzero" api:"required"`
// Message timestamp to react to
Timestamp string `json:"timestamp" api:"required"`
// Connection ID. If omitted, auto-resolved from provider + user.
Connection param.Opt[string] `json:"connection,omitzero"`
// contains filtered or unexported fields
}
func (ActionAddReactionParams) MarshalJSON ¶
func (r ActionAddReactionParams) MarshalJSON() (data []byte, err error)
func (*ActionAddReactionParams) UnmarshalJSON ¶
func (r *ActionAddReactionParams) UnmarshalJSON(data []byte) error
type ActionAddReactionParamsProvider ¶
type ActionAddReactionParamsProvider string
Integration provider (e.g., slack)
const ( ActionAddReactionParamsProviderReddit ActionAddReactionParamsProvider = "reddit" ActionAddReactionParamsProviderNotion ActionAddReactionParamsProvider = "notion" ActionAddReactionParamsProviderSlack ActionAddReactionParamsProvider = "slack" ActionAddReactionParamsProviderGoogleCalendar ActionAddReactionParamsProvider = "google_calendar" ActionAddReactionParamsProviderGoogleMail ActionAddReactionParamsProvider = "google_mail" ActionAddReactionParamsProviderBox ActionAddReactionParamsProvider = "box" ActionAddReactionParamsProviderDropbox ActionAddReactionParamsProvider = "dropbox" ActionAddReactionParamsProviderGoogleDrive ActionAddReactionParamsProvider = "google_drive" ActionAddReactionParamsProviderGitHub ActionAddReactionParamsProvider = "github" ActionAddReactionParamsProviderVault ActionAddReactionParamsProvider = "vault" ActionAddReactionParamsProviderWebCrawler ActionAddReactionParamsProvider = "web_crawler" ActionAddReactionParamsProviderTrace ActionAddReactionParamsProvider = "trace" ActionAddReactionParamsProviderMicrosoftTeams ActionAddReactionParamsProvider = "microsoft_teams" ActionAddReactionParamsProviderGmailActions ActionAddReactionParamsProvider = "gmail_actions" )
type ActionAddReactionResponse ¶
type ActionAddReactionResponse struct {
Success bool `json:"success" api:"required"`
Error string `json:"error" api:"nullable"`
ProviderResponse map[string]any `json:"provider_response" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
Error respjson.Field
ProviderResponse respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result from executing an integration action.
func (ActionAddReactionResponse) RawJSON ¶
func (r ActionAddReactionResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionAddReactionResponse) UnmarshalJSON ¶
func (r *ActionAddReactionResponse) UnmarshalJSON(data []byte) error
type ActionSendMessageParams ¶
type ActionSendMessageParams struct {
// Integration provider (e.g., slack)
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Provider ActionSendMessageParamsProvider `json:"provider,omitzero" api:"required"`
// Message text
Text string `json:"text" api:"required"`
// Channel ID (required for Slack)
Channel param.Opt[string] `json:"channel,omitzero"`
// Connection ID. If omitted, auto-resolved from provider + user.
Connection param.Opt[string] `json:"connection,omitzero"`
// Parent message ID for threading (thread_ts for Slack)
Parent param.Opt[string] `json:"parent,omitzero"`
// contains filtered or unexported fields
}
func (ActionSendMessageParams) MarshalJSON ¶
func (r ActionSendMessageParams) MarshalJSON() (data []byte, err error)
func (*ActionSendMessageParams) UnmarshalJSON ¶
func (r *ActionSendMessageParams) UnmarshalJSON(data []byte) error
type ActionSendMessageParamsProvider ¶
type ActionSendMessageParamsProvider string
Integration provider (e.g., slack)
const ( ActionSendMessageParamsProviderReddit ActionSendMessageParamsProvider = "reddit" ActionSendMessageParamsProviderNotion ActionSendMessageParamsProvider = "notion" ActionSendMessageParamsProviderSlack ActionSendMessageParamsProvider = "slack" ActionSendMessageParamsProviderGoogleCalendar ActionSendMessageParamsProvider = "google_calendar" ActionSendMessageParamsProviderGoogleMail ActionSendMessageParamsProvider = "google_mail" ActionSendMessageParamsProviderBox ActionSendMessageParamsProvider = "box" ActionSendMessageParamsProviderDropbox ActionSendMessageParamsProvider = "dropbox" ActionSendMessageParamsProviderGoogleDrive ActionSendMessageParamsProvider = "google_drive" ActionSendMessageParamsProviderGitHub ActionSendMessageParamsProvider = "github" ActionSendMessageParamsProviderVault ActionSendMessageParamsProvider = "vault" ActionSendMessageParamsProviderWebCrawler ActionSendMessageParamsProvider = "web_crawler" ActionSendMessageParamsProviderTrace ActionSendMessageParamsProvider = "trace" ActionSendMessageParamsProviderMicrosoftTeams ActionSendMessageParamsProvider = "microsoft_teams" ActionSendMessageParamsProviderGmailActions ActionSendMessageParamsProvider = "gmail_actions" )
type ActionSendMessageResponse ¶
type ActionSendMessageResponse struct {
Success bool `json:"success" api:"required"`
Error string `json:"error" api:"nullable"`
ProviderResponse map[string]any `json:"provider_response" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
Error respjson.Field
ProviderResponse respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result from executing an integration action.
func (ActionSendMessageResponse) RawJSON ¶
func (r ActionSendMessageResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionSendMessageResponse) UnmarshalJSON ¶
func (r *ActionSendMessageResponse) UnmarshalJSON(data []byte) error
type ActionService ¶
type ActionService struct {
// contains filtered or unexported fields
}
ActionService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewActionService method instead.
func NewActionService ¶
func NewActionService(opts ...option.RequestOption) (r ActionService)
NewActionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ActionService) AddReaction ¶
func (r *ActionService) AddReaction(ctx context.Context, body ActionAddReactionParams, opts ...option.RequestOption) (res *ActionAddReactionResponse, err error)
Add an emoji reaction to a message on a connected integration.
func (*ActionService) SendMessage ¶
func (r *ActionService) SendMessage(ctx context.Context, body ActionSendMessageParams, opts ...option.RequestOption) (res *ActionSendMessageResponse, err error)
Send a message to a channel or conversation on a connected integration.
type AuthDeleteUserResponse ¶
type AuthDeleteUserResponse struct {
Message string `json:"message" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthDeleteUserResponse) RawJSON ¶
func (r AuthDeleteUserResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthDeleteUserResponse) UnmarshalJSON ¶
func (r *AuthDeleteUserResponse) UnmarshalJSON(data []byte) error
type AuthMeResponse ¶
type AuthMeResponse struct {
// The user's id
ID string `json:"id" api:"required"`
// The Hyperspell app's id this user belongs to
App AuthMeResponseApp `json:"app" api:"required"`
// All integrations available for the app
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
AvailableIntegrations []string `json:"available_integrations" api:"required"`
// All integrations installed for the user
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
InstalledIntegrations []string `json:"installed_integrations" api:"required"`
// The expiration time of the user token used to make the request
TokenExpiration time.Time `json:"token_expiration" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
App respjson.Field
AvailableIntegrations respjson.Field
InstalledIntegrations respjson.Field
TokenExpiration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthMeResponse) RawJSON ¶
func (r AuthMeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthMeResponse) UnmarshalJSON ¶
func (r *AuthMeResponse) UnmarshalJSON(data []byte) error
type AuthMeResponseApp ¶
type AuthMeResponseApp struct {
// The Hyperspell app's id this user belongs to
ID string `json:"id" api:"required"`
// The app's icon
IconURL string `json:"icon_url" api:"required"`
// The app's name
Name string `json:"name" api:"required"`
// The app's redirect URL
RedirectURL string `json:"redirect_url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
IconURL respjson.Field
Name respjson.Field
RedirectURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The Hyperspell app's id this user belongs to
func (AuthMeResponseApp) RawJSON ¶
func (r AuthMeResponseApp) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthMeResponseApp) UnmarshalJSON ¶
func (r *AuthMeResponseApp) UnmarshalJSON(data []byte) error
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
AuthService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuthService method instead.
func NewAuthService ¶
func NewAuthService(opts ...option.RequestOption) (r AuthService)
NewAuthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AuthService) DeleteUser ¶
func (r *AuthService) DeleteUser(ctx context.Context, opts ...option.RequestOption) (res *AuthDeleteUserResponse, err error)
Endpoint to delete user.
func (*AuthService) Me ¶
func (r *AuthService) Me(ctx context.Context, opts ...option.RequestOption) (res *AuthMeResponse, err error)
Endpoint to get basic user data.
func (*AuthService) UserToken ¶
func (r *AuthService) UserToken(ctx context.Context, body AuthUserTokenParams, opts ...option.RequestOption) (res *Token, err error)
Use this endpoint to create a user token for a specific user. This token can be safely passed to your user-facing front-end.
type AuthUserTokenParams ¶
type AuthUserTokenParams struct {
UserID string `json:"user_id" api:"required"`
// Token lifetime, e.g., '30m', '2h', '1d'. Defaults to 24 hours if not provided.
ExpiresIn param.Opt[string] `json:"expires_in,omitzero"`
// Origin of the request, used for CSRF protection. If set, the token will only be
// valid for requests originating from this origin.
Origin param.Opt[string] `json:"origin,omitzero"`
// contains filtered or unexported fields
}
func (AuthUserTokenParams) MarshalJSON ¶
func (r AuthUserTokenParams) MarshalJSON() (data []byte, err error)
func (*AuthUserTokenParams) UnmarshalJSON ¶
func (r *AuthUserTokenParams) UnmarshalJSON(data []byte) error
type Calendar ¶
type Calendar struct {
Items []CalendarItem `json:"items" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Calendar) UnmarshalJSON ¶
type CalendarItem ¶
type CalendarItem struct {
// The ID of the calendar
ID string `json:"id" api:"required"`
// The name of the calendar
Name string `json:"name" api:"required"`
// Whether the calendar is the primary calendar of the user
Primary bool `json:"primary" api:"required"`
// Default timezone of the calendar
Timezone string `json:"timezone" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
Primary respjson.Field
Timezone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CalendarItem) RawJSON ¶
func (r CalendarItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*CalendarItem) UnmarshalJSON ¶
func (r *CalendarItem) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Connections ConnectionService
Folders FolderService
Integrations IntegrationService
Memories MemoryService
Evaluate EvaluateService
Actions ActionService
Sessions SessionService
Vaults VaultService
Auth AuthService
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the hyperspell API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (HYPERSPELL_API_KEY, HYPERSPELL_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ConnectionListResponse ¶
type ConnectionListResponse struct {
Connections []ConnectionListResponseConnection `json:"connections" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Connections respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ConnectionListResponse) RawJSON ¶
func (r ConnectionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConnectionListResponse) UnmarshalJSON ¶
func (r *ConnectionListResponse) UnmarshalJSON(data []byte) error
type ConnectionListResponseConnection ¶
type ConnectionListResponseConnection struct {
// The connection's id
ID string `json:"id" api:"required"`
// The connection's integration id
IntegrationID string `json:"integration_id" api:"required"`
// The connection's label
Label string `json:"label" api:"required"`
// The connection's provider
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Provider string `json:"provider" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
IntegrationID respjson.Field
Label respjson.Field
Provider respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ConnectionListResponseConnection) RawJSON ¶
func (r ConnectionListResponseConnection) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConnectionListResponseConnection) UnmarshalJSON ¶
func (r *ConnectionListResponseConnection) UnmarshalJSON(data []byte) error
type ConnectionRevokeResponse ¶
type ConnectionRevokeResponse struct {
Message string `json:"message" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ConnectionRevokeResponse) RawJSON ¶
func (r ConnectionRevokeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConnectionRevokeResponse) UnmarshalJSON ¶
func (r *ConnectionRevokeResponse) UnmarshalJSON(data []byte) error
type ConnectionService ¶
type ConnectionService struct {
// contains filtered or unexported fields
}
ConnectionService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConnectionService method instead.
func NewConnectionService ¶
func NewConnectionService(opts ...option.RequestOption) (r ConnectionService)
NewConnectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ConnectionService) List ¶
func (r *ConnectionService) List(ctx context.Context, opts ...option.RequestOption) (res *ConnectionListResponse, err error)
List all connections for the user.
func (*ConnectionService) Revoke ¶
func (r *ConnectionService) Revoke(ctx context.Context, connectionID string, opts ...option.RequestOption) (res *ConnectionRevokeResponse, err error)
Revokes Hyperspell's access the given provider and deletes all stored credentials and indexed data.
type EvaluateScoreHighlightParams ¶
type EvaluateScoreHighlightParams struct {
// Comment on the chunk
Comment param.Opt[string] `json:"comment,omitzero"`
// Rating of the chunk from -1 (bad) to +1 (good).
Score param.Opt[float64] `json:"score,omitzero"`
// contains filtered or unexported fields
}
func (EvaluateScoreHighlightParams) MarshalJSON ¶
func (r EvaluateScoreHighlightParams) MarshalJSON() (data []byte, err error)
func (*EvaluateScoreHighlightParams) UnmarshalJSON ¶
func (r *EvaluateScoreHighlightParams) UnmarshalJSON(data []byte) error
type EvaluateScoreHighlightResponse ¶
type EvaluateScoreHighlightResponse struct {
// A message describing the result.
Message string `json:"message" api:"required"`
// Whether the feedback was successfully saved.
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EvaluateScoreHighlightResponse) RawJSON ¶
func (r EvaluateScoreHighlightResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvaluateScoreHighlightResponse) UnmarshalJSON ¶
func (r *EvaluateScoreHighlightResponse) UnmarshalJSON(data []byte) error
type EvaluateScoreQueryParams ¶
type EvaluateScoreQueryParams struct {
// Rating of the query result from -1 (bad) to +1 (good).
Score param.Opt[float64] `json:"score,omitzero"`
// contains filtered or unexported fields
}
func (EvaluateScoreQueryParams) MarshalJSON ¶
func (r EvaluateScoreQueryParams) MarshalJSON() (data []byte, err error)
func (*EvaluateScoreQueryParams) UnmarshalJSON ¶
func (r *EvaluateScoreQueryParams) UnmarshalJSON(data []byte) error
type EvaluateScoreQueryResponse ¶
type EvaluateScoreQueryResponse struct {
// A message describing the result.
Message string `json:"message" api:"required"`
// Whether the feedback was successfully saved.
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EvaluateScoreQueryResponse) RawJSON ¶
func (r EvaluateScoreQueryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvaluateScoreQueryResponse) UnmarshalJSON ¶
func (r *EvaluateScoreQueryResponse) UnmarshalJSON(data []byte) error
type EvaluateService ¶
type EvaluateService struct {
// contains filtered or unexported fields
}
EvaluateService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvaluateService method instead.
func NewEvaluateService ¶
func NewEvaluateService(opts ...option.RequestOption) (r EvaluateService)
NewEvaluateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvaluateService) GetQuery ¶
func (r *EvaluateService) GetQuery(ctx context.Context, queryID string, opts ...option.RequestOption) (res *shared.QueryResult, err error)
Retrieve the result of a previous query.
func (*EvaluateService) ScoreHighlight ¶
func (r *EvaluateService) ScoreHighlight(ctx context.Context, highlightID string, body EvaluateScoreHighlightParams, opts ...option.RequestOption) (res *EvaluateScoreHighlightResponse, err error)
Score an individual highlight.
func (*EvaluateService) ScoreQuery ¶
func (r *EvaluateService) ScoreQuery(ctx context.Context, queryID string, body EvaluateScoreQueryParams, opts ...option.RequestOption) (res *EvaluateScoreQueryResponse, err error)
Score the result of a query.
type FolderDeletePolicyParams ¶
type FolderDeletePolicyParams struct {
ConnectionID string `path:"connection_id" api:"required" format:"uuid" json:"-"`
// contains filtered or unexported fields
}
type FolderDeletePolicyResponse ¶
type FolderDeletePolicyResponse struct {
// Whether the deletion was successful
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderDeletePolicyResponse) RawJSON ¶
func (r FolderDeletePolicyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderDeletePolicyResponse) UnmarshalJSON ¶
func (r *FolderDeletePolicyResponse) UnmarshalJSON(data []byte) error
type FolderListParams ¶
type FolderListParams struct {
// Parent folder ID. Omit for root-level folders.
ParentID param.Opt[string] `query:"parent_id,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FolderListParams) URLQuery ¶
func (r FolderListParams) URLQuery() (v url.Values, err error)
URLQuery serializes FolderListParams's query parameters as `url.Values`.
type FolderListPoliciesResponse ¶
type FolderListPoliciesResponse struct {
// List of folder policies
Policies []FolderListPoliciesResponsePolicy `json:"policies" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Policies respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderListPoliciesResponse) RawJSON ¶
func (r FolderListPoliciesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderListPoliciesResponse) UnmarshalJSON ¶
func (r *FolderListPoliciesResponse) UnmarshalJSON(data []byte) error
type FolderListPoliciesResponsePolicy ¶
type FolderListPoliciesResponsePolicy struct {
// Unique policy ID
ID string `json:"id" api:"required" format:"uuid"`
// Folder ID from the source provider
ProviderFolderID string `json:"provider_folder_id" api:"required"`
// Sync mode for this folder
//
// Any of "sync", "skip", "manual".
SyncMode string `json:"sync_mode" api:"required"`
// Connection ID (null for integration defaults)
ConnectionID string `json:"connection_id" api:"nullable" format:"uuid"`
// Display name of the folder
FolderName string `json:"folder_name" api:"nullable"`
// Display path of the folder
FolderPath string `json:"folder_path" api:"nullable"`
// Parent folder's provider ID
ParentFolderID string `json:"parent_folder_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ProviderFolderID respjson.Field
SyncMode respjson.Field
ConnectionID respjson.Field
FolderName respjson.Field
FolderPath respjson.Field
ParentFolderID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderListPoliciesResponsePolicy) RawJSON ¶
func (r FolderListPoliciesResponsePolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderListPoliciesResponsePolicy) UnmarshalJSON ¶
func (r *FolderListPoliciesResponsePolicy) UnmarshalJSON(data []byte) error
type FolderListResponse ¶
type FolderListResponse struct {
// Folders at this level
Folders []FolderListResponseFolder `json:"folders" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Folders respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderListResponse) RawJSON ¶
func (r FolderListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderListResponse) UnmarshalJSON ¶
func (r *FolderListResponse) UnmarshalJSON(data []byte) error
type FolderListResponseFolder ¶
type FolderListResponseFolder struct {
// Whether this folder may have subfolders
HasChildren bool `json:"has_children" api:"required"`
// Display name of the folder
Name string `json:"name" api:"required"`
// Folder ID from the source provider
ProviderFolderID string `json:"provider_folder_id" api:"required"`
// Parent folder's provider ID
ParentFolderID string `json:"parent_folder_id" api:"nullable"`
// Explicit policy on this folder, or null if inheriting/default
Policy FolderListResponseFolderPolicy `json:"policy" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasChildren respjson.Field
Name respjson.Field
ProviderFolderID respjson.Field
ParentFolderID respjson.Field
Policy respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderListResponseFolder) RawJSON ¶
func (r FolderListResponseFolder) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderListResponseFolder) UnmarshalJSON ¶
func (r *FolderListResponseFolder) UnmarshalJSON(data []byte) error
type FolderListResponseFolderPolicy ¶
type FolderListResponseFolderPolicy struct {
// Policy UUID
ID string `json:"id" api:"required" format:"uuid"`
// Sync mode set on this folder
//
// Any of "sync", "skip", "manual".
SyncMode string `json:"sync_mode" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
SyncMode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Explicit policy on this folder, or null if inheriting/default
func (FolderListResponseFolderPolicy) RawJSON ¶
func (r FolderListResponseFolderPolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderListResponseFolderPolicy) UnmarshalJSON ¶
func (r *FolderListResponseFolderPolicy) UnmarshalJSON(data []byte) error
type FolderService ¶
type FolderService struct {
// contains filtered or unexported fields
}
FolderService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFolderService method instead.
func NewFolderService ¶
func NewFolderService(opts ...option.RequestOption) (r FolderService)
NewFolderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FolderService) DeletePolicy ¶
func (r *FolderService) DeletePolicy(ctx context.Context, policyID string, body FolderDeletePolicyParams, opts ...option.RequestOption) (res *FolderDeletePolicyResponse, err error)
Delete a folder policy for a specific connection.
func (*FolderService) List ¶
func (r *FolderService) List(ctx context.Context, connectionID string, query FolderListParams, opts ...option.RequestOption) (res *FolderListResponse, err error)
List one level of folders from the user's connected source.
Returns folders decorated with their explicit folder policy (if any). Use parent_id to drill into subfolders.
func (*FolderService) ListPolicies ¶
func (r *FolderService) ListPolicies(ctx context.Context, connectionID string, opts ...option.RequestOption) (res *FolderListPoliciesResponse, err error)
List all folder policies for a specific connection.
func (*FolderService) SetPolicies ¶
func (r *FolderService) SetPolicies(ctx context.Context, connectionID string, body FolderSetPoliciesParams, opts ...option.RequestOption) (res *FolderSetPoliciesResponse, err error)
Create or update a folder policy for a specific connection.
type FolderSetPoliciesParams ¶
type FolderSetPoliciesParams struct {
// Folder ID from the source provider
ProviderFolderID string `json:"provider_folder_id" api:"required"`
// Sync mode for this folder
//
// Any of "sync", "skip", "manual".
SyncMode FolderSetPoliciesParamsSyncMode `json:"sync_mode,omitzero" api:"required"`
// Display name of the folder
FolderName param.Opt[string] `json:"folder_name,omitzero"`
// Display path of the folder
FolderPath param.Opt[string] `json:"folder_path,omitzero"`
// Parent folder's provider ID for inheritance resolution
ParentFolderID param.Opt[string] `json:"parent_folder_id,omitzero"`
// contains filtered or unexported fields
}
func (FolderSetPoliciesParams) MarshalJSON ¶
func (r FolderSetPoliciesParams) MarshalJSON() (data []byte, err error)
func (*FolderSetPoliciesParams) UnmarshalJSON ¶
func (r *FolderSetPoliciesParams) UnmarshalJSON(data []byte) error
type FolderSetPoliciesParamsSyncMode ¶
type FolderSetPoliciesParamsSyncMode string
Sync mode for this folder
const ( FolderSetPoliciesParamsSyncModeSync FolderSetPoliciesParamsSyncMode = "sync" FolderSetPoliciesParamsSyncModeSkip FolderSetPoliciesParamsSyncMode = "skip" FolderSetPoliciesParamsSyncModeManual FolderSetPoliciesParamsSyncMode = "manual" )
type FolderSetPoliciesResponse ¶
type FolderSetPoliciesResponse struct {
// Unique policy ID
ID string `json:"id" api:"required" format:"uuid"`
// Folder ID from the source provider
ProviderFolderID string `json:"provider_folder_id" api:"required"`
// Sync mode for this folder
//
// Any of "sync", "skip", "manual".
SyncMode FolderSetPoliciesResponseSyncMode `json:"sync_mode" api:"required"`
// Connection ID (null for integration defaults)
ConnectionID string `json:"connection_id" api:"nullable" format:"uuid"`
// Display name of the folder
FolderName string `json:"folder_name" api:"nullable"`
// Display path of the folder
FolderPath string `json:"folder_path" api:"nullable"`
// Parent folder's provider ID
ParentFolderID string `json:"parent_folder_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ProviderFolderID respjson.Field
SyncMode respjson.Field
ConnectionID respjson.Field
FolderName respjson.Field
FolderPath respjson.Field
ParentFolderID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderSetPoliciesResponse) RawJSON ¶
func (r FolderSetPoliciesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderSetPoliciesResponse) UnmarshalJSON ¶
func (r *FolderSetPoliciesResponse) UnmarshalJSON(data []byte) error
type FolderSetPoliciesResponseSyncMode ¶
type FolderSetPoliciesResponseSyncMode string
Sync mode for this folder
const ( FolderSetPoliciesResponseSyncModeSync FolderSetPoliciesResponseSyncMode = "sync" FolderSetPoliciesResponseSyncModeSkip FolderSetPoliciesResponseSyncMode = "skip" FolderSetPoliciesResponseSyncModeManual FolderSetPoliciesResponseSyncMode = "manual" )
type IntegrationConnectParams ¶
type IntegrationConnectParams struct {
RedirectURL param.Opt[string] `query:"redirect_url,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (IntegrationConnectParams) URLQuery ¶
func (r IntegrationConnectParams) URLQuery() (v url.Values, err error)
URLQuery serializes IntegrationConnectParams's query parameters as `url.Values`.
type IntegrationConnectResponse ¶
type IntegrationConnectResponse struct {
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (IntegrationConnectResponse) RawJSON ¶
func (r IntegrationConnectResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*IntegrationConnectResponse) UnmarshalJSON ¶
func (r *IntegrationConnectResponse) UnmarshalJSON(data []byte) error
type IntegrationGoogleCalendarService ¶
type IntegrationGoogleCalendarService struct {
// contains filtered or unexported fields
}
IntegrationGoogleCalendarService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIntegrationGoogleCalendarService method instead.
func NewIntegrationGoogleCalendarService ¶
func NewIntegrationGoogleCalendarService(opts ...option.RequestOption) (r IntegrationGoogleCalendarService)
NewIntegrationGoogleCalendarService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IntegrationGoogleCalendarService) List ¶
func (r *IntegrationGoogleCalendarService) List(ctx context.Context, opts ...option.RequestOption) (res *Calendar, err error)
List available calendars for a user. This can be used to ie. populate a dropdown for the user to select a calendar.
type IntegrationListResponse ¶
type IntegrationListResponse struct {
Integrations []IntegrationListResponseIntegration `json:"integrations" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Integrations respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (IntegrationListResponse) RawJSON ¶
func (r IntegrationListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*IntegrationListResponse) UnmarshalJSON ¶
func (r *IntegrationListResponse) UnmarshalJSON(data []byte) error
type IntegrationListResponseIntegration ¶
type IntegrationListResponseIntegration struct {
// The integration's id
ID string `json:"id" api:"required"`
// Whether the integration allows multiple connections
AllowMultipleConnections bool `json:"allow_multiple_connections" api:"required"`
// The integration's auth provider
//
// Any of "nango", "unified", "whitelabel".
AuthProvider string `json:"auth_provider" api:"required"`
// URL to the integration's icon
Icon string `json:"icon" api:"required"`
// The integration's display name
Name string `json:"name" api:"required"`
// The integration's provider
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Provider string `json:"provider" api:"required"`
// Whether this integration only supports write actions (no sync)
ActionsOnly bool `json:"actions_only"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AllowMultipleConnections respjson.Field
AuthProvider respjson.Field
Icon respjson.Field
Name respjson.Field
Provider respjson.Field
ActionsOnly respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (IntegrationListResponseIntegration) RawJSON ¶
func (r IntegrationListResponseIntegration) RawJSON() string
Returns the unmodified JSON received from the API
func (*IntegrationListResponseIntegration) UnmarshalJSON ¶
func (r *IntegrationListResponseIntegration) UnmarshalJSON(data []byte) error
type IntegrationService ¶
type IntegrationService struct {
GoogleCalendar IntegrationGoogleCalendarService
WebCrawler IntegrationWebCrawlerService
Slack IntegrationSlackService
// contains filtered or unexported fields
}
IntegrationService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIntegrationService method instead.
func NewIntegrationService ¶
func NewIntegrationService(opts ...option.RequestOption) (r IntegrationService)
NewIntegrationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IntegrationService) Connect ¶
func (r *IntegrationService) Connect(ctx context.Context, integrationID string, query IntegrationConnectParams, opts ...option.RequestOption) (res *IntegrationConnectResponse, err error)
Redirects to the connect URL to link an integration.
func (*IntegrationService) List ¶
func (r *IntegrationService) List(ctx context.Context, opts ...option.RequestOption) (res *IntegrationListResponse, err error)
List all integrations for the user.
type IntegrationSlackListParams ¶
type IntegrationSlackListParams struct {
// If set, pass 'exclude_archived' to Slack. If None, omit the param.
ExcludeArchived param.Opt[bool] `query:"exclude_archived,omitzero" json:"-"`
// Include direct messages (im) when listing conversations.
IncludeDms param.Opt[bool] `query:"include_dms,omitzero" json:"-"`
// Include group DMs (mpim) when listing conversations.
IncludeGroupDms param.Opt[bool] `query:"include_group_dms,omitzero" json:"-"`
// Include private channels when constructing Slack 'types'.
IncludePrivate param.Opt[bool] `query:"include_private,omitzero" json:"-"`
// List of Slack channels to include (by id, name, or #name).
Channels []string `query:"channels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (IntegrationSlackListParams) URLQuery ¶
func (r IntegrationSlackListParams) URLQuery() (v url.Values, err error)
URLQuery serializes IntegrationSlackListParams's query parameters as `url.Values`.
type IntegrationSlackListResponse ¶
type IntegrationSlackListResponse = any
type IntegrationSlackService ¶
type IntegrationSlackService struct {
// contains filtered or unexported fields
}
IntegrationSlackService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIntegrationSlackService method instead.
func NewIntegrationSlackService ¶
func NewIntegrationSlackService(opts ...option.RequestOption) (r IntegrationSlackService)
NewIntegrationSlackService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IntegrationSlackService) List ¶
func (r *IntegrationSlackService) List(ctx context.Context, query IntegrationSlackListParams, opts ...option.RequestOption) (res *IntegrationSlackListResponse, err error)
List Slack conversations accessible to the user via the live Nango connection.
Returns minimal channel metadata suitable for selection UIs. If required scopes are missing, Slack's error is propagated with details.
Supports filtering by channels, including/excluding private channels, DMs, group DMs, and archived channels based on the provided search options.
type IntegrationWebCrawlerIndexParams ¶
type IntegrationWebCrawlerIndexParams struct {
// The base URL of the website to crawl
URL string `query:"url" api:"required" json:"-"`
// Maximum number of pages to crawl in total
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Maximum depth of links to follow during crawling
MaxDepth param.Opt[int64] `query:"max_depth,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (IntegrationWebCrawlerIndexParams) URLQuery ¶
func (r IntegrationWebCrawlerIndexParams) URLQuery() (v url.Values, err error)
URLQuery serializes IntegrationWebCrawlerIndexParams's query parameters as `url.Values`.
type IntegrationWebCrawlerIndexResponse ¶
type IntegrationWebCrawlerIndexResponse struct {
ResourceID string `json:"resource_id" api:"required"`
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source IntegrationWebCrawlerIndexResponseSource `json:"source" api:"required"`
// Any of "pending", "processing", "completed", "failed", "pending_review",
// "skipped".
Status IntegrationWebCrawlerIndexResponseStatus `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ResourceID respjson.Field
Source respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (IntegrationWebCrawlerIndexResponse) RawJSON ¶
func (r IntegrationWebCrawlerIndexResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*IntegrationWebCrawlerIndexResponse) UnmarshalJSON ¶
func (r *IntegrationWebCrawlerIndexResponse) UnmarshalJSON(data []byte) error
type IntegrationWebCrawlerIndexResponseSource ¶
type IntegrationWebCrawlerIndexResponseSource string
const ( IntegrationWebCrawlerIndexResponseSourceReddit IntegrationWebCrawlerIndexResponseSource = "reddit" IntegrationWebCrawlerIndexResponseSourceNotion IntegrationWebCrawlerIndexResponseSource = "notion" IntegrationWebCrawlerIndexResponseSourceSlack IntegrationWebCrawlerIndexResponseSource = "slack" IntegrationWebCrawlerIndexResponseSourceGoogleCalendar IntegrationWebCrawlerIndexResponseSource = "google_calendar" IntegrationWebCrawlerIndexResponseSourceGoogleMail IntegrationWebCrawlerIndexResponseSource = "google_mail" IntegrationWebCrawlerIndexResponseSourceBox IntegrationWebCrawlerIndexResponseSource = "box" IntegrationWebCrawlerIndexResponseSourceDropbox IntegrationWebCrawlerIndexResponseSource = "dropbox" IntegrationWebCrawlerIndexResponseSourceGoogleDrive IntegrationWebCrawlerIndexResponseSource = "google_drive" IntegrationWebCrawlerIndexResponseSourceGitHub IntegrationWebCrawlerIndexResponseSource = "github" IntegrationWebCrawlerIndexResponseSourceVault IntegrationWebCrawlerIndexResponseSource = "vault" IntegrationWebCrawlerIndexResponseSourceWebCrawler IntegrationWebCrawlerIndexResponseSource = "web_crawler" IntegrationWebCrawlerIndexResponseSourceTrace IntegrationWebCrawlerIndexResponseSource = "trace" IntegrationWebCrawlerIndexResponseSourceMicrosoftTeams IntegrationWebCrawlerIndexResponseSource = "microsoft_teams" IntegrationWebCrawlerIndexResponseSourceGmailActions IntegrationWebCrawlerIndexResponseSource = "gmail_actions" )
type IntegrationWebCrawlerIndexResponseStatus ¶
type IntegrationWebCrawlerIndexResponseStatus string
const ( IntegrationWebCrawlerIndexResponseStatusPending IntegrationWebCrawlerIndexResponseStatus = "pending" IntegrationWebCrawlerIndexResponseStatusProcessing IntegrationWebCrawlerIndexResponseStatus = "processing" IntegrationWebCrawlerIndexResponseStatusCompleted IntegrationWebCrawlerIndexResponseStatus = "completed" IntegrationWebCrawlerIndexResponseStatusFailed IntegrationWebCrawlerIndexResponseStatus = "failed" IntegrationWebCrawlerIndexResponseStatusPendingReview IntegrationWebCrawlerIndexResponseStatus = "pending_review" IntegrationWebCrawlerIndexResponseStatusSkipped IntegrationWebCrawlerIndexResponseStatus = "skipped" )
type IntegrationWebCrawlerService ¶
type IntegrationWebCrawlerService struct {
// contains filtered or unexported fields
}
IntegrationWebCrawlerService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIntegrationWebCrawlerService method instead.
func NewIntegrationWebCrawlerService ¶
func NewIntegrationWebCrawlerService(opts ...option.RequestOption) (r IntegrationWebCrawlerService)
NewIntegrationWebCrawlerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IntegrationWebCrawlerService) Index ¶
func (r *IntegrationWebCrawlerService) Index(ctx context.Context, query IntegrationWebCrawlerIndexParams, opts ...option.RequestOption) (res *IntegrationWebCrawlerIndexResponse, err error)
Recursively crawl a website to make it available for indexed search.
type Memory ¶
type Memory struct {
ResourceID string `json:"resource_id" api:"required"`
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemorySource `json:"source" api:"required"`
// The type of document (e.g. Document, Website, Email)
Type string `json:"type" api:"required"`
// The structured content of the document
Data []any `json:"data" api:"nullable"`
// Summaries of all memories extracted from this document
Memories []string `json:"memories"`
Metadata shared.Metadata `json:"metadata"`
Title string `json:"title" api:"nullable"`
ExtraFields map[string]any `json:"" api:"extrafields"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ResourceID respjson.Field
Source respjson.Field
Type respjson.Field
Data respjson.Field
Memories respjson.Field
Metadata respjson.Field
Title respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response model for the GET /memories/get endpoint.
func (*Memory) UnmarshalJSON ¶
type MemoryAddBulkParams ¶
type MemoryAddBulkParams struct {
// List of memories to ingest. Maximum 100 items.
Items []MemoryAddBulkParamsItem `json:"items,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (MemoryAddBulkParams) MarshalJSON ¶
func (r MemoryAddBulkParams) MarshalJSON() (data []byte, err error)
func (*MemoryAddBulkParams) UnmarshalJSON ¶
func (r *MemoryAddBulkParams) UnmarshalJSON(data []byte) error
type MemoryAddBulkParamsItem ¶
type MemoryAddBulkParamsItem struct {
// Full text of the document.
Text string `json:"text" api:"required"`
// The collection to add the document to — deprecated, set the collection using
// metadata instead.
//
// Deprecated: deprecated
Collection param.Opt[string] `json:"collection,omitzero"`
// Title of the document.
Title param.Opt[string] `json:"title,omitzero"`
// Date of the document. Depending on the document, this could be the creation date
// or date the document was last updated (eg. for a chat transcript, this would be
// the date of the last message). This helps the ranking algorithm and allows you
// to filter by date range.
Date param.Opt[time.Time] `json:"date,omitzero" format:"date-time"`
// The resource ID to add the document to. If not provided, a new resource ID will
// be generated. If provided, the document will be updated if it already exists.
ResourceID param.Opt[string] `json:"resource_id,omitzero"`
// Custom metadata for filtering. Keys must be alphanumeric with underscores, max
// 64 chars. Values must be string, number, boolean, or null.
Metadata map[string]MemoryAddBulkParamsItemMetadataUnion `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
The property Text is required.
func (MemoryAddBulkParamsItem) MarshalJSON ¶
func (r MemoryAddBulkParamsItem) MarshalJSON() (data []byte, err error)
func (*MemoryAddBulkParamsItem) UnmarshalJSON ¶
func (r *MemoryAddBulkParamsItem) UnmarshalJSON(data []byte) error
type MemoryAddBulkParamsItemMetadataUnion ¶
type MemoryAddBulkParamsItemMetadataUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (MemoryAddBulkParamsItemMetadataUnion) MarshalJSON ¶
func (u MemoryAddBulkParamsItemMetadataUnion) MarshalJSON() ([]byte, error)
func (*MemoryAddBulkParamsItemMetadataUnion) UnmarshalJSON ¶
func (u *MemoryAddBulkParamsItemMetadataUnion) UnmarshalJSON(data []byte) error
type MemoryAddBulkResponse ¶
type MemoryAddBulkResponse struct {
// Number of items successfully processed
Count int64 `json:"count" api:"required"`
// Status of each ingested item
Items []MemoryStatus `json:"items" api:"required"`
Success bool `json:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Items respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response schema for successful bulk ingestion.
func (MemoryAddBulkResponse) RawJSON ¶
func (r MemoryAddBulkResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MemoryAddBulkResponse) UnmarshalJSON ¶
func (r *MemoryAddBulkResponse) UnmarshalJSON(data []byte) error
type MemoryAddParams ¶
type MemoryAddParams struct {
// Full text of the document.
Text string `json:"text" api:"required"`
// The collection to add the document to — deprecated, set the collection using
// metadata instead.
Collection param.Opt[string] `json:"collection,omitzero"`
// Title of the document.
Title param.Opt[string] `json:"title,omitzero"`
// Date of the document. Depending on the document, this could be the creation date
// or date the document was last updated (eg. for a chat transcript, this would be
// the date of the last message). This helps the ranking algorithm and allows you
// to filter by date range.
Date param.Opt[time.Time] `json:"date,omitzero" format:"date-time"`
// The resource ID to add the document to. If not provided, a new resource ID will
// be generated. If provided, the document will be updated if it already exists.
ResourceID param.Opt[string] `json:"resource_id,omitzero"`
// Custom metadata for filtering. Keys must be alphanumeric with underscores, max
// 64 chars. Values must be string, number, boolean, or null.
Metadata map[string]MemoryAddParamsMetadataUnion `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (MemoryAddParams) MarshalJSON ¶
func (r MemoryAddParams) MarshalJSON() (data []byte, err error)
func (*MemoryAddParams) UnmarshalJSON ¶
func (r *MemoryAddParams) UnmarshalJSON(data []byte) error
type MemoryAddParamsMetadataUnion ¶
type MemoryAddParamsMetadataUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (MemoryAddParamsMetadataUnion) MarshalJSON ¶
func (u MemoryAddParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*MemoryAddParamsMetadataUnion) UnmarshalJSON ¶
func (u *MemoryAddParamsMetadataUnion) UnmarshalJSON(data []byte) error
type MemoryDeleteParams ¶
type MemoryDeleteParams struct {
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemoryDeleteParamsSource `path:"source,omitzero" api:"required" json:"-"`
// contains filtered or unexported fields
}
type MemoryDeleteParamsSource ¶
type MemoryDeleteParamsSource string
const ( MemoryDeleteParamsSourceReddit MemoryDeleteParamsSource = "reddit" MemoryDeleteParamsSourceNotion MemoryDeleteParamsSource = "notion" MemoryDeleteParamsSourceSlack MemoryDeleteParamsSource = "slack" MemoryDeleteParamsSourceGoogleCalendar MemoryDeleteParamsSource = "google_calendar" MemoryDeleteParamsSourceGoogleMail MemoryDeleteParamsSource = "google_mail" MemoryDeleteParamsSourceBox MemoryDeleteParamsSource = "box" MemoryDeleteParamsSourceDropbox MemoryDeleteParamsSource = "dropbox" MemoryDeleteParamsSourceGoogleDrive MemoryDeleteParamsSource = "google_drive" MemoryDeleteParamsSourceGitHub MemoryDeleteParamsSource = "github" MemoryDeleteParamsSourceVault MemoryDeleteParamsSource = "vault" MemoryDeleteParamsSourceWebCrawler MemoryDeleteParamsSource = "web_crawler" MemoryDeleteParamsSourceTrace MemoryDeleteParamsSource = "trace" MemoryDeleteParamsSourceMicrosoftTeams MemoryDeleteParamsSource = "microsoft_teams" MemoryDeleteParamsSourceGmailActions MemoryDeleteParamsSource = "gmail_actions" )
type MemoryDeleteResponse ¶
type MemoryDeleteResponse struct {
ChunksDeleted int64 `json:"chunks_deleted" api:"required"`
Message string `json:"message" api:"required"`
ResourceID string `json:"resource_id" api:"required"`
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemoryDeleteResponseSource `json:"source" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ChunksDeleted respjson.Field
Message respjson.Field
ResourceID respjson.Field
Source respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MemoryDeleteResponse) RawJSON ¶
func (r MemoryDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MemoryDeleteResponse) UnmarshalJSON ¶
func (r *MemoryDeleteResponse) UnmarshalJSON(data []byte) error
type MemoryDeleteResponseSource ¶
type MemoryDeleteResponseSource string
const ( MemoryDeleteResponseSourceReddit MemoryDeleteResponseSource = "reddit" MemoryDeleteResponseSourceNotion MemoryDeleteResponseSource = "notion" MemoryDeleteResponseSourceSlack MemoryDeleteResponseSource = "slack" MemoryDeleteResponseSourceGoogleCalendar MemoryDeleteResponseSource = "google_calendar" MemoryDeleteResponseSourceGoogleMail MemoryDeleteResponseSource = "google_mail" MemoryDeleteResponseSourceBox MemoryDeleteResponseSource = "box" MemoryDeleteResponseSourceDropbox MemoryDeleteResponseSource = "dropbox" MemoryDeleteResponseSourceGoogleDrive MemoryDeleteResponseSource = "google_drive" MemoryDeleteResponseSourceGitHub MemoryDeleteResponseSource = "github" MemoryDeleteResponseSourceVault MemoryDeleteResponseSource = "vault" MemoryDeleteResponseSourceWebCrawler MemoryDeleteResponseSource = "web_crawler" MemoryDeleteResponseSourceTrace MemoryDeleteResponseSource = "trace" MemoryDeleteResponseSourceMicrosoftTeams MemoryDeleteResponseSource = "microsoft_teams" MemoryDeleteResponseSourceGmailActions MemoryDeleteResponseSource = "gmail_actions" )
type MemoryGetParams ¶
type MemoryGetParams struct {
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemoryGetParamsSource `path:"source,omitzero" api:"required" json:"-"`
// contains filtered or unexported fields
}
type MemoryGetParamsSource ¶
type MemoryGetParamsSource string
const ( MemoryGetParamsSourceReddit MemoryGetParamsSource = "reddit" MemoryGetParamsSourceNotion MemoryGetParamsSource = "notion" MemoryGetParamsSourceSlack MemoryGetParamsSource = "slack" MemoryGetParamsSourceGoogleCalendar MemoryGetParamsSource = "google_calendar" MemoryGetParamsSourceGoogleMail MemoryGetParamsSource = "google_mail" MemoryGetParamsSourceBox MemoryGetParamsSource = "box" MemoryGetParamsSourceDropbox MemoryGetParamsSource = "dropbox" MemoryGetParamsSourceGoogleDrive MemoryGetParamsSource = "google_drive" MemoryGetParamsSourceGitHub MemoryGetParamsSource = "github" MemoryGetParamsSourceVault MemoryGetParamsSource = "vault" MemoryGetParamsSourceWebCrawler MemoryGetParamsSource = "web_crawler" MemoryGetParamsSourceTrace MemoryGetParamsSource = "trace" MemoryGetParamsSourceMicrosoftTeams MemoryGetParamsSource = "microsoft_teams" MemoryGetParamsSourceGmailActions MemoryGetParamsSource = "gmail_actions" )
type MemoryListParams ¶
type MemoryListParams struct {
// Filter documents by collection.
Collection param.Opt[string] `query:"collection,omitzero" json:"-"`
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Filter documents by metadata using MongoDB-style operators. Example:
// {"department": "engineering", "priority": {"$gt": 3}}
Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
Size param.Opt[int64] `query:"size,omitzero" json:"-"`
// Filter documents by source.
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemoryListParamsSource `query:"source,omitzero" json:"-"`
// Filter documents by status.
//
// Any of "pending", "processing", "completed", "failed", "pending_review",
// "skipped".
Status MemoryListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MemoryListParams) URLQuery ¶
func (r MemoryListParams) URLQuery() (v url.Values, err error)
URLQuery serializes MemoryListParams's query parameters as `url.Values`.
type MemoryListParamsSource ¶
type MemoryListParamsSource string
Filter documents by source.
const ( MemoryListParamsSourceReddit MemoryListParamsSource = "reddit" MemoryListParamsSourceNotion MemoryListParamsSource = "notion" MemoryListParamsSourceSlack MemoryListParamsSource = "slack" MemoryListParamsSourceGoogleCalendar MemoryListParamsSource = "google_calendar" MemoryListParamsSourceGoogleMail MemoryListParamsSource = "google_mail" MemoryListParamsSourceBox MemoryListParamsSource = "box" MemoryListParamsSourceDropbox MemoryListParamsSource = "dropbox" MemoryListParamsSourceGoogleDrive MemoryListParamsSource = "google_drive" MemoryListParamsSourceGitHub MemoryListParamsSource = "github" MemoryListParamsSourceVault MemoryListParamsSource = "vault" MemoryListParamsSourceWebCrawler MemoryListParamsSource = "web_crawler" MemoryListParamsSourceTrace MemoryListParamsSource = "trace" MemoryListParamsSourceMicrosoftTeams MemoryListParamsSource = "microsoft_teams" MemoryListParamsSourceGmailActions MemoryListParamsSource = "gmail_actions" )
type MemoryListParamsStatus ¶
type MemoryListParamsStatus string
Filter documents by status.
const ( MemoryListParamsStatusPending MemoryListParamsStatus = "pending" MemoryListParamsStatusProcessing MemoryListParamsStatus = "processing" MemoryListParamsStatusCompleted MemoryListParamsStatus = "completed" MemoryListParamsStatusFailed MemoryListParamsStatus = "failed" MemoryListParamsStatusPendingReview MemoryListParamsStatus = "pending_review" MemoryListParamsStatusSkipped MemoryListParamsStatus = "skipped" )
type MemorySearchParams ¶
type MemorySearchParams struct {
// Query to run.
Query string `json:"query" api:"required"`
// If true, the query will be answered along with matching source documents.
Answer param.Opt[bool] `json:"answer,omitzero"`
// Effort level. 0 = pass query through verbatim. 1 = LLM rewrites the query for
// better retrieval and extracts date filters.
Effort param.Opt[int64] `json:"effort,omitzero"`
// Maximum number of results to return.
MaxResults param.Opt[int64] `json:"max_results,omitzero"`
// Search options for the query.
Options MemorySearchParamsOptions `json:"options,omitzero"`
// Only query documents from these sources.
//
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Sources []string `json:"sources,omitzero"`
// contains filtered or unexported fields
}
func (MemorySearchParams) MarshalJSON ¶
func (r MemorySearchParams) MarshalJSON() (data []byte, err error)
func (*MemorySearchParams) UnmarshalJSON ¶
func (r *MemorySearchParams) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptions ¶
type MemorySearchParamsOptions struct {
// Only query documents created on or after this date.
After param.Opt[time.Time] `json:"after,omitzero" format:"date-time"`
// Only query documents created before this date.
Before param.Opt[time.Time] `json:"before,omitzero" format:"date-time"`
// Maximum number of results to return.
MaxResults param.Opt[int64] `json:"max_results,omitzero"`
// Metadata filters using MongoDB-style operators. Example: {'status': 'published',
// 'priority': {'$gt': 3}}
Filter map[string]any `json:"filter,omitzero"`
// Only return results from these specific resource IDs. Useful for scoping
// searches to specific documents (e.g., a specific email thread or uploaded file).
ResourceIDs []string `json:"resource_ids,omitzero"`
// Model to use for answer generation when answer=True
//
// Any of "llama-3.1", "gemma2", "qwen-qwq", "mistral-saba", "llama-4-scout",
// "deepseek-r1", "gpt-oss-20b", "gpt-oss-120b".
AnswerModel string `json:"answer_model,omitzero"`
// Search options for Box
Box MemorySearchParamsOptionsBox `json:"box,omitzero"`
// Search options for Google Calendar
GoogleCalendar MemorySearchParamsOptionsGoogleCalendar `json:"google_calendar,omitzero"`
// Search options for Google Drive
GoogleDrive MemorySearchParamsOptionsGoogleDrive `json:"google_drive,omitzero"`
// Search options for Gmail
GoogleMail MemorySearchParamsOptionsGoogleMail `json:"google_mail,omitzero"`
// Filter by memory type. Defaults to generic memories only. Pass multiple types to
// include procedures, etc.
//
// Any of "procedure", "memory", "mood".
MemoryTypes []string `json:"memory_types,omitzero"`
// Search options for Notion
Notion MemorySearchParamsOptionsNotion `json:"notion,omitzero"`
// Search options for Reddit
Reddit MemorySearchParamsOptionsReddit `json:"reddit,omitzero"`
// Search options for Slack
Slack MemorySearchParamsOptionsSlack `json:"slack,omitzero"`
// Search options for vault
Vault MemorySearchParamsOptionsVault `json:"vault,omitzero"`
// Search options for Web Crawler
WebCrawler MemorySearchParamsOptionsWebCrawler `json:"web_crawler,omitzero"`
// contains filtered or unexported fields
}
Search options for the query.
func (MemorySearchParamsOptions) MarshalJSON ¶
func (r MemorySearchParamsOptions) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptions) UnmarshalJSON ¶
func (r *MemorySearchParamsOptions) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsBox ¶
type MemorySearchParamsOptionsBox struct {
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// contains filtered or unexported fields
}
Search options for Box
func (MemorySearchParamsOptionsBox) MarshalJSON ¶
func (r MemorySearchParamsOptionsBox) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsBox) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsBox) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsGoogleCalendar ¶
type MemorySearchParamsOptionsGoogleCalendar struct {
// The ID of the calendar to search. If not provided, it will use the ID of the
// default calendar. You can get the list of calendars with the
// `/integrations/google_calendar/list` endpoint.
CalendarID param.Opt[string] `json:"calendar_id,omitzero"`
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// contains filtered or unexported fields
}
Search options for Google Calendar
func (MemorySearchParamsOptionsGoogleCalendar) MarshalJSON ¶
func (r MemorySearchParamsOptionsGoogleCalendar) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsGoogleCalendar) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsGoogleCalendar) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsGoogleDrive ¶
type MemorySearchParamsOptionsGoogleDrive struct {
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// contains filtered or unexported fields
}
Search options for Google Drive
func (MemorySearchParamsOptionsGoogleDrive) MarshalJSON ¶
func (r MemorySearchParamsOptionsGoogleDrive) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsGoogleDrive) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsGoogleDrive) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsGoogleMail ¶
type MemorySearchParamsOptionsGoogleMail struct {
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// List of label IDs to filter messages (e.g., ['INBOX', 'SENT', 'DRAFT']).
// Multiple labels are combined with OR logic - messages matching ANY specified
// label will be returned. If empty, no label filtering is applied (searches all
// accessible messages).
LabelIDs []string `json:"label_ids,omitzero"`
// contains filtered or unexported fields
}
Search options for Gmail
func (MemorySearchParamsOptionsGoogleMail) MarshalJSON ¶
func (r MemorySearchParamsOptionsGoogleMail) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsGoogleMail) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsGoogleMail) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsNotion ¶
type MemorySearchParamsOptionsNotion struct {
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// List of Notion page IDs to search. If not provided, all pages in the workspace
// will be searched.
NotionPageIDs []string `json:"notion_page_ids,omitzero"`
// contains filtered or unexported fields
}
Search options for Notion
func (MemorySearchParamsOptionsNotion) MarshalJSON ¶
func (r MemorySearchParamsOptionsNotion) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsNotion) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsNotion) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsReddit ¶
type MemorySearchParamsOptionsReddit struct {
// The subreddit to search. If not provided, the query will be searched for in all
// subreddits.
Subreddit param.Opt[string] `json:"subreddit,omitzero"`
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// The time period to search. Defaults to 'month'.
//
// Any of "hour", "day", "week", "month", "year", "all".
Period string `json:"period,omitzero"`
// The sort order of the posts. Defaults to 'relevance'.
//
// Any of "relevance", "new", "hot", "top", "comments".
Sort string `json:"sort,omitzero"`
// contains filtered or unexported fields
}
Search options for Reddit
func (MemorySearchParamsOptionsReddit) MarshalJSON ¶
func (r MemorySearchParamsOptionsReddit) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsReddit) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsReddit) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsSlack ¶
type MemorySearchParamsOptionsSlack struct {
// If set, pass 'exclude_archived' to Slack. If None, omit the param.
ExcludeArchived param.Opt[bool] `json:"exclude_archived,omitzero"`
// Include direct messages (im) when listing conversations.
IncludeDms param.Opt[bool] `json:"include_dms,omitzero"`
// Include group DMs (mpim) when listing conversations.
IncludeGroupDms param.Opt[bool] `json:"include_group_dms,omitzero"`
// Include private channels when constructing Slack 'types'. Defaults to False to
// preserve existing cassette query params.
IncludePrivate param.Opt[bool] `json:"include_private,omitzero"`
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// List of Slack channels to include (by id, name, or #name).
Channels []string `json:"channels,omitzero"`
// contains filtered or unexported fields
}
Search options for Slack
func (MemorySearchParamsOptionsSlack) MarshalJSON ¶
func (r MemorySearchParamsOptionsSlack) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsSlack) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsSlack) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsVault ¶
type MemorySearchParamsOptionsVault struct {
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// contains filtered or unexported fields
}
Search options for vault
func (MemorySearchParamsOptionsVault) MarshalJSON ¶
func (r MemorySearchParamsOptionsVault) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsVault) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsVault) UnmarshalJSON(data []byte) error
type MemorySearchParamsOptionsWebCrawler ¶
type MemorySearchParamsOptionsWebCrawler struct {
// The URL to crawl
URL param.Opt[string] `json:"url,omitzero"`
// Maximum depth to crawl from the starting URL
MaxDepth param.Opt[int64] `json:"max_depth,omitzero"`
// Weight of results from this source. A weight greater than 1.0 means more results
// from this source will be returned, a weight less than 1.0 means fewer results
// will be returned. This will only affect results if multiple sources are queried
// at the same time.
Weight param.Opt[float64] `json:"weight,omitzero"`
// contains filtered or unexported fields
}
Search options for Web Crawler
func (MemorySearchParamsOptionsWebCrawler) MarshalJSON ¶
func (r MemorySearchParamsOptionsWebCrawler) MarshalJSON() (data []byte, err error)
func (*MemorySearchParamsOptionsWebCrawler) UnmarshalJSON ¶
func (r *MemorySearchParamsOptionsWebCrawler) UnmarshalJSON(data []byte) error
type MemoryService ¶
type MemoryService struct {
// contains filtered or unexported fields
}
MemoryService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMemoryService method instead.
func NewMemoryService ¶
func NewMemoryService(opts ...option.RequestOption) (r MemoryService)
NewMemoryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MemoryService) Add ¶
func (r *MemoryService) Add(ctx context.Context, body MemoryAddParams, opts ...option.RequestOption) (res *MemoryStatus, err error)
Adds an arbitrary document to the index. This can be any text, email, call transcript, etc. The document will be processed and made available for querying once the processing is complete.
func (*MemoryService) AddBulk ¶
func (r *MemoryService) AddBulk(ctx context.Context, body MemoryAddBulkParams, opts ...option.RequestOption) (res *MemoryAddBulkResponse, err error)
Adds multiple documents to the index in a single request.
All items are validated before any database operations occur. If any item fails validation, the entire batch is rejected with a 422 error detailing which items failed and why.
Maximum 100 items per request. Each item follows the same schema as the single-item /memories/add endpoint.
func (*MemoryService) Delete ¶
func (r *MemoryService) Delete(ctx context.Context, resourceID string, body MemoryDeleteParams, opts ...option.RequestOption) (res *MemoryDeleteResponse, err error)
Delete a memory and its associated chunks from the index.
This removes the memory completely from the vector index and database. The operation deletes:
1. All chunks associated with the resource (including embeddings) 2. The resource record itself
Args: source: The document provider (e.g., gmail, notion, vault) resource_id: The unique identifier of the resource to delete api_token: Authentication token
Returns: MemoryDeletionResponse with deletion details
Raises: DocumentNotFound: If the resource doesn't exist or user doesn't have access
func (*MemoryService) Get ¶
func (r *MemoryService) Get(ctx context.Context, resourceID string, query MemoryGetParams, opts ...option.RequestOption) (res *Memory, err error)
Retrieves a document by provider and resource_id.
func (*MemoryService) List ¶
func (r *MemoryService) List(ctx context.Context, query MemoryListParams, opts ...option.RequestOption) (res *pagination.CursorPage[shared.Resource], err error)
This endpoint allows you to paginate through all documents in the index. You can filter the documents by title, date, metadata, etc.
func (*MemoryService) ListAutoPaging ¶
func (r *MemoryService) ListAutoPaging(ctx context.Context, query MemoryListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[shared.Resource]
This endpoint allows you to paginate through all documents in the index. You can filter the documents by title, date, metadata, etc.
func (*MemoryService) Search ¶
func (r *MemoryService) Search(ctx context.Context, body MemorySearchParams, opts ...option.RequestOption) (res *shared.QueryResult, err error)
Retrieves documents matching the query.
func (*MemoryService) Status ¶
func (r *MemoryService) Status(ctx context.Context, opts ...option.RequestOption) (res *MemoryStatusResponse, err error)
This endpoint shows the indexing progress of documents, both by provider and total.
func (*MemoryService) Update ¶
func (r *MemoryService) Update(ctx context.Context, resourceID string, params MemoryUpdateParams, opts ...option.RequestOption) (res *MemoryStatus, err error)
Updates an existing document in the index. You can update the text, collection, title, and metadata. The document must already exist or a 404 will be returned. This works for documents from any source (vault, slack, gmail, etc.).
To remove a collection, set it to null explicitly.
func (*MemoryService) Upload ¶
func (r *MemoryService) Upload(ctx context.Context, body MemoryUploadParams, opts ...option.RequestOption) (res *MemoryStatus, err error)
This endpoint will upload a file to the index and return a resource_id. The file will be processed in the background and the memory will be available for querying once the processing is complete. You can use the `resource_id` to query the memory later, and check the status of the memory.
type MemorySource ¶
type MemorySource string
const ( MemorySourceReddit MemorySource = "reddit" MemorySourceNotion MemorySource = "notion" MemorySourceSlack MemorySource = "slack" MemorySourceGoogleCalendar MemorySource = "google_calendar" MemorySourceGoogleMail MemorySource = "google_mail" MemorySourceBox MemorySource = "box" MemorySourceDropbox MemorySource = "dropbox" MemorySourceGoogleDrive MemorySource = "google_drive" MemorySourceGitHub MemorySource = "github" MemorySourceVault MemorySource = "vault" MemorySourceWebCrawler MemorySource = "web_crawler" MemorySourceTrace MemorySource = "trace" MemorySourceMicrosoftTeams MemorySource = "microsoft_teams" MemorySourceGmailActions MemorySource = "gmail_actions" )
type MemoryStatus ¶
type MemoryStatus struct {
ResourceID string `json:"resource_id" api:"required"`
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemoryStatusSource `json:"source" api:"required"`
// Any of "pending", "processing", "completed", "failed", "pending_review",
// "skipped".
Status MemoryStatusStatus `json:"status" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ResourceID respjson.Field
Source respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MemoryStatus) RawJSON ¶
func (r MemoryStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*MemoryStatus) UnmarshalJSON ¶
func (r *MemoryStatus) UnmarshalJSON(data []byte) error
type MemoryStatusResponse ¶
type MemoryStatusResponse struct {
Providers map[string]map[string]int64 `json:"providers" api:"required"`
Total map[string]int64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Providers respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MemoryStatusResponse) RawJSON ¶
func (r MemoryStatusResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MemoryStatusResponse) UnmarshalJSON ¶
func (r *MemoryStatusResponse) UnmarshalJSON(data []byte) error
type MemoryStatusSource ¶
type MemoryStatusSource string
const ( MemoryStatusSourceReddit MemoryStatusSource = "reddit" MemoryStatusSourceNotion MemoryStatusSource = "notion" MemoryStatusSourceSlack MemoryStatusSource = "slack" MemoryStatusSourceGoogleCalendar MemoryStatusSource = "google_calendar" MemoryStatusSourceGoogleMail MemoryStatusSource = "google_mail" MemoryStatusSourceBox MemoryStatusSource = "box" MemoryStatusSourceDropbox MemoryStatusSource = "dropbox" MemoryStatusSourceGoogleDrive MemoryStatusSource = "google_drive" MemoryStatusSourceGitHub MemoryStatusSource = "github" MemoryStatusSourceVault MemoryStatusSource = "vault" MemoryStatusSourceWebCrawler MemoryStatusSource = "web_crawler" MemoryStatusSourceTrace MemoryStatusSource = "trace" MemoryStatusSourceMicrosoftTeams MemoryStatusSource = "microsoft_teams" MemoryStatusSourceGmailActions MemoryStatusSource = "gmail_actions" )
type MemoryStatusStatus ¶
type MemoryStatusStatus string
const ( MemoryStatusStatusPending MemoryStatusStatus = "pending" MemoryStatusStatusProcessing MemoryStatusStatus = "processing" MemoryStatusStatusCompleted MemoryStatusStatus = "completed" MemoryStatusStatusFailed MemoryStatusStatus = "failed" MemoryStatusStatusPendingReview MemoryStatusStatus = "pending_review" MemoryStatusStatusSkipped MemoryStatusStatus = "skipped" )
type MemoryUpdateParams ¶
type MemoryUpdateParams struct {
// Any of "reddit", "notion", "slack", "google_calendar", "google_mail", "box",
// "dropbox", "google_drive", "github", "vault", "web_crawler", "trace",
// "microsoft_teams", "gmail_actions".
Source MemoryUpdateParamsSource `path:"source,omitzero" api:"required" json:"-"`
// The collection to move the document to — deprecated, set the collection using
// metadata instead.
Collection any `json:"collection,omitzero"`
// Custom metadata for filtering. Keys must be alphanumeric with underscores, max
// 64 chars. Values must be string, number, boolean, or null. Will be merged with
// existing metadata.
Metadata map[string]MemoryUpdateParamsMetadataUnion `json:"metadata,omitzero"`
// Full text of the document. If provided, the document will be re-indexed.
Text any `json:"text,omitzero"`
// Title of the document.
Title any `json:"title,omitzero"`
// contains filtered or unexported fields
}
func (MemoryUpdateParams) MarshalJSON ¶
func (r MemoryUpdateParams) MarshalJSON() (data []byte, err error)
func (*MemoryUpdateParams) UnmarshalJSON ¶
func (r *MemoryUpdateParams) UnmarshalJSON(data []byte) error
type MemoryUpdateParamsMetadataUnion ¶
type MemoryUpdateParamsMetadataUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (MemoryUpdateParamsMetadataUnion) MarshalJSON ¶
func (u MemoryUpdateParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*MemoryUpdateParamsMetadataUnion) UnmarshalJSON ¶
func (u *MemoryUpdateParamsMetadataUnion) UnmarshalJSON(data []byte) error
type MemoryUpdateParamsSource ¶
type MemoryUpdateParamsSource string
const ( MemoryUpdateParamsSourceReddit MemoryUpdateParamsSource = "reddit" MemoryUpdateParamsSourceNotion MemoryUpdateParamsSource = "notion" MemoryUpdateParamsSourceSlack MemoryUpdateParamsSource = "slack" MemoryUpdateParamsSourceGoogleCalendar MemoryUpdateParamsSource = "google_calendar" MemoryUpdateParamsSourceGoogleMail MemoryUpdateParamsSource = "google_mail" MemoryUpdateParamsSourceBox MemoryUpdateParamsSource = "box" MemoryUpdateParamsSourceDropbox MemoryUpdateParamsSource = "dropbox" MemoryUpdateParamsSourceGoogleDrive MemoryUpdateParamsSource = "google_drive" MemoryUpdateParamsSourceGitHub MemoryUpdateParamsSource = "github" MemoryUpdateParamsSourceVault MemoryUpdateParamsSource = "vault" MemoryUpdateParamsSourceWebCrawler MemoryUpdateParamsSource = "web_crawler" MemoryUpdateParamsSourceTrace MemoryUpdateParamsSource = "trace" MemoryUpdateParamsSourceMicrosoftTeams MemoryUpdateParamsSource = "microsoft_teams" MemoryUpdateParamsSourceGmailActions MemoryUpdateParamsSource = "gmail_actions" )
type MemoryUploadParams ¶
type MemoryUploadParams struct {
// The file to ingest.
File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
// The collection to add the document to — deprecated, set the collection using
// metadata instead.
Collection param.Opt[string] `json:"collection,omitzero"`
// Custom metadata as JSON string for filtering. Keys must be alphanumeric with
// underscores, max 64 chars. Values must be string, number, or boolean.
Metadata param.Opt[string] `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (MemoryUploadParams) MarshalMultipart ¶
func (r MemoryUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
type MetadataStatus ¶
type MetadataStatus = shared.MetadataStatus
This is an alias to an internal type.
type NotificationType ¶
type NotificationType = shared.NotificationType
This is an alias to an internal type.
type ResourceSource ¶
type ResourceSource = shared.ResourceSource
This is an alias to an internal type.
type SessionAddParams ¶
type SessionAddParams struct {
// The trace history as a string. Can be a JSON array of Hyperdoc steps, a JSON
// array of Vercel AI SDK steps, or OpenClaw JSONL.
History string `json:"history" api:"required"`
// Title of the trace
Title param.Opt[string] `json:"title,omitzero"`
// Date of the trace
Date param.Opt[time.Time] `json:"date,omitzero" format:"date-time"`
// Resource identifier for the trace.
SessionID param.Opt[string] `json:"session_id,omitzero"`
// Trace format: 'vercel', 'hyperdoc', or 'openclaw'. Auto-detected if not set.
//
// Any of "vercel", "hyperdoc", "openclaw".
Format SessionAddParamsFormat `json:"format,omitzero"`
// Custom metadata for filtering. Keys must be alphanumeric with underscores, max
// 64 chars.
Metadata map[string]SessionAddParamsMetadataUnion `json:"metadata,omitzero"`
// What kind of memories to extract from the trace
//
// Any of "procedure", "memory", "mood".
Extract []string `json:"extract,omitzero"`
// contains filtered or unexported fields
}
func (SessionAddParams) MarshalJSON ¶
func (r SessionAddParams) MarshalJSON() (data []byte, err error)
func (*SessionAddParams) UnmarshalJSON ¶
func (r *SessionAddParams) UnmarshalJSON(data []byte) error
type SessionAddParamsFormat ¶
type SessionAddParamsFormat string
Trace format: 'vercel', 'hyperdoc', or 'openclaw'. Auto-detected if not set.
const ( SessionAddParamsFormatVercel SessionAddParamsFormat = "vercel" SessionAddParamsFormatHyperdoc SessionAddParamsFormat = "hyperdoc" SessionAddParamsFormatOpenclaw SessionAddParamsFormat = "openclaw" )
type SessionAddParamsMetadataUnion ¶
type SessionAddParamsMetadataUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (SessionAddParamsMetadataUnion) MarshalJSON ¶
func (u SessionAddParamsMetadataUnion) MarshalJSON() ([]byte, error)
func (*SessionAddParamsMetadataUnion) UnmarshalJSON ¶
func (u *SessionAddParamsMetadataUnion) UnmarshalJSON(data []byte) error
type SessionService ¶
type SessionService struct {
// contains filtered or unexported fields
}
SessionService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSessionService method instead.
func NewSessionService ¶
func NewSessionService(opts ...option.RequestOption) (r SessionService)
NewSessionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SessionService) Add ¶
func (r *SessionService) Add(ctx context.Context, body SessionAddParams, opts ...option.RequestOption) (res *MemoryStatus, err error)
Add an agent trace/transcript to the index.
Accepts traces as a string in Hyperdoc format (native), Vercel AI SDK format, or OpenClaw JSONL format. The format is auto-detected if not specified.
**Hyperdoc format** (JSON array, snake_case with type discriminators):
```json
{
"history": "[{\"type\": \"trace_message\", \"role\": \"user\", \"text\": \"Hello\"}]"
}
```
**Vercel AI SDK format** (JSON array, camelCase):
```json { "history": "[{\"role\": \"user\", \"content\": \"Hello\"}]" } ```
**OpenClaw JSONL format** (newline-delimited JSON):
```json
{
"history": "{\"type\":\"session\",\"id\":\"abc\"}\n{\"type\":\"message\",\"message\":{\"role\":\"user\",...}}"
}
```
type Token ¶
type Token struct {
Token string `json:"token" api:"required"`
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
ExpiresAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Token) UnmarshalJSON ¶
type VaultListParams ¶
type VaultListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Size param.Opt[int64] `query:"size,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VaultListParams) URLQuery ¶
func (r VaultListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VaultListParams's query parameters as `url.Values`.
type VaultListResponse ¶
type VaultListResponse struct {
Collection string `json:"collection" api:"required"`
DocumentCount int64 `json:"document_count" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Collection respjson.Field
DocumentCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VaultListResponse) RawJSON ¶
func (r VaultListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VaultListResponse) UnmarshalJSON ¶
func (r *VaultListResponse) UnmarshalJSON(data []byte) error
type VaultService ¶
type VaultService struct {
// contains filtered or unexported fields
}
VaultService contains methods and other services that help with interacting with the hyperspell API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVaultService method instead.
func NewVaultService ¶
func NewVaultService(opts ...option.RequestOption) (r VaultService)
NewVaultService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VaultService) List
deprecated
func (r *VaultService) List(ctx context.Context, query VaultListParams, opts ...option.RequestOption) (res *pagination.CursorPage[VaultListResponse], err error)
This endpoint lists all collections, and how many documents are in each collection. All documents that do not have a collection assigned are in the `null` collection.
Deprecated: This method will be removed in the future
func (*VaultService) ListAutoPaging
deprecated
func (r *VaultService) ListAutoPaging(ctx context.Context, query VaultListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[VaultListResponse]
This endpoint lists all collections, and how many documents are in each collection. All documents that do not have a collection assigned are in the `null` collection.
Deprecated: This method will be removed in the future
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|