Documentation
¶
Index ¶
- 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 AudioMetadata
- type AudioMetadataFormat
- type AudioMetadataMimeType
- 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 Error
- type NewsGetRecapsParams
- type NewsGetRecapsResponse
- type NewsGetRecapsResponseMeta
- type NewsListFeedsResponse
- type NewsListFeedsResponseData
- type NewsListFeedsResponseMeta
- type NewsListParams
- type NewsListResponse
- type NewsListResponseData
- type NewsListResponseMeta
- type NewsService
- func (r *NewsService) GetRecaps(ctx context.Context, query NewsGetRecapsParams, opts ...option.RequestOption) (res *NewsGetRecapsResponse, err error)
- func (r *NewsService) List(ctx context.Context, query NewsListParams, opts ...option.RequestOption) (res *NewsListResponse, err error)
- func (r *NewsService) ListFeeds(ctx context.Context, opts ...option.RequestOption) (res *NewsListFeedsResponse, err error)
- type ProfileDeleteResponse
- type ProfileDeleteResponseData
- type ProfileDeleteResponseMeta
- type ProfileListResponse
- type ProfileListResponseData
- type ProfileListResponseDataProfile
- type ProfileListResponseMeta
- type ProfileNewParams
- type ProfileNewParamsFrequency
- type ProfileNewParamsRecursionConfig
- type ProfileNewResponse
- type ProfileNewResponseData
- type ProfileNewResponseMeta
- type ProfilePartialUpdateParams
- type ProfilePartialUpdateParamsAudioConfig
- type ProfilePartialUpdateParamsBudgetConfig
- type ProfilePartialUpdateParamsFrequency
- type ProfilePartialUpdateParamsFreshnessConfig
- type ProfilePartialUpdateParamsModelConfig
- type ProfilePartialUpdateParamsRecursionConfig
- type ProfilePartialUpdateParamsSearchConfig
- type ProfilePartialUpdateParamsStatus
- type ProfilePartialUpdateResponse
- type ProfilePartialUpdateResponseData
- type ProfilePartialUpdateResponseMeta
- type ProfileService
- func (r *ProfileService) Delete(ctx context.Context, profileID string, opts ...option.RequestOption) (res *ProfileDeleteResponse, err error)
- func (r *ProfileService) List(ctx context.Context, opts ...option.RequestOption) (res *ProfileListResponse, err error)
- func (r *ProfileService) New(ctx context.Context, body ProfileNewParams, opts ...option.RequestOption) (res *ProfileNewResponse, err error)
- func (r *ProfileService) PartialUpdate(ctx context.Context, profileID string, body ProfilePartialUpdateParams, ...) (res *ProfilePartialUpdateResponse, err error)
- func (r *ProfileService) Update(ctx context.Context, profileID string, body ProfileUpdateParams, ...) (res *ProfileUpdateResponse, err error)
- type ProfileUpdateParams
- type ProfileUpdateParamsAudioConfig
- type ProfileUpdateParamsBudgetConfig
- type ProfileUpdateParamsFrequency
- type ProfileUpdateParamsFreshnessConfig
- type ProfileUpdateParamsModelConfig
- type ProfileUpdateParamsRecursionConfig
- type ProfileUpdateParamsSearchConfig
- type ProfileUpdateParamsStatus
- type ProfileUpdateResponse
- type ProfileUpdateResponseData
- type ProfileUpdateResponseMeta
- type ReportGetAudioParams
- type ReportGetAudioResponse
- type ReportGetResponse
- type ReportGetResponseData
- type ReportGetResponseDataContent
- type ReportGetResponseDataMetadata
- type ReportGetResponseDataMetadataFreshnessMetadata
- type ReportGetResponseDataMetadataRecursionMetadata
- type ReportListParams
- type ReportListResponse
- type ReportListResponseData
- type ReportListResponseMeta
- type ReportService
- func (r *ReportService) Get(ctx context.Context, reportID string, opts ...option.RequestOption) (res *ReportGetResponse, err error)
- func (r *ReportService) GetAudio(ctx context.Context, reportID string, query ReportGetAudioParams, ...) (res *ReportGetAudioResponse, err error)
- func (r *ReportService) List(ctx context.Context, query ReportListParams, opts ...option.RequestOption) (res *ReportListResponse, err error)
- type TimeframeEnum
- type TopicEnum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (Y2_API_KEY, Y2_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AudioMetadata ¶
type AudioMetadata struct {
// Duration in seconds
Duration float64 `json:"duration"`
// Duration as HH:MM:SS
DurationFormatted string `json:"durationFormatted"`
// File size in bytes
FileSize int64 `json:"fileSize"`
// Any of "mp3".
Format AudioMetadataFormat `json:"format"`
// Any of "audio/mpeg".
MimeType AudioMetadataMimeType `json:"mimeType"`
// Convex storage ID for internal reference
StorageID string `json:"storageId"`
// CDN URL for audio file
URL string `json:"url" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Duration respjson.Field
DurationFormatted respjson.Field
FileSize respjson.Field
Format respjson.Field
MimeType respjson.Field
StorageID respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AudioMetadata) RawJSON ¶
func (r AudioMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioMetadata) UnmarshalJSON ¶
func (r *AudioMetadata) UnmarshalJSON(data []byte) error
type AudioMetadataFormat ¶
type AudioMetadataFormat string
const (
AudioMetadataFormatMP3 AudioMetadataFormat = "mp3"
)
type AudioMetadataMimeType ¶
type AudioMetadataMimeType string
const (
AudioMetadataMimeTypeAudioMpeg AudioMetadataMimeType = "audio/mpeg"
)
type Client ¶
type Client struct {
Options []option.RequestOption
Reports ReportService
Profiles ProfileService
News NewsService
}
Client creates a struct with services and top level methods that help with interacting with the y2 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 (Y2_API_KEY, Y2_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 NewsGetRecapsParams ¶
type NewsGetRecapsParams struct {
// Comma-separated list of topics. Valid topics: ai, ai_agents, aptos, base,
// bitcoin, crypto, dats, defi, ethereum, hyperliquid, machine_learning, macro,
// ondo, perps, ripple, rwa, solana, tech, virtuals
Topics param.Opt[string] `query:"topics,omitzero" json:"-"`
// Time period for recaps
//
// Any of "12h", "24h", "3d", "7d".
Timeframe TimeframeEnum `query:"timeframe,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NewsGetRecapsParams) URLQuery ¶
func (r NewsGetRecapsParams) URLQuery() (v url.Values, err error)
URLQuery serializes NewsGetRecapsParams's query parameters as `url.Values`.
type NewsGetRecapsResponse ¶
type NewsGetRecapsResponse struct {
Data map[string]any `json:"data,required"`
Meta NewsGetRecapsResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsGetRecapsResponse) RawJSON ¶
func (r NewsGetRecapsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsGetRecapsResponse) UnmarshalJSON ¶
func (r *NewsGetRecapsResponse) UnmarshalJSON(data []byte) error
type NewsGetRecapsResponseMeta ¶
type NewsGetRecapsResponseMeta struct {
// Time period for recap data
//
// Any of "12h", "24h", "3d", "7d".
Timeframe TimeframeEnum `json:"timeframe"`
Topics []TopicEnum `json:"topics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Timeframe respjson.Field
Topics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsGetRecapsResponseMeta) RawJSON ¶
func (r NewsGetRecapsResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsGetRecapsResponseMeta) UnmarshalJSON ¶
func (r *NewsGetRecapsResponseMeta) UnmarshalJSON(data []byte) error
type NewsListFeedsResponse ¶
type NewsListFeedsResponse struct {
Data []NewsListFeedsResponseData `json:"data,required"`
Meta NewsListFeedsResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsListFeedsResponse) RawJSON ¶
func (r NewsListFeedsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsListFeedsResponse) UnmarshalJSON ¶
func (r *NewsListFeedsResponse) UnmarshalJSON(data []byte) error
type NewsListFeedsResponseData ¶
type NewsListFeedsResponseData struct {
// Available news feed topics from GloriaAI
//
// Any of "ai", "ai_agents", "aptos", "base", "bitcoin", "crypto", "dats", "defi",
// "ethereum", "hyperliquid", "machine_learning", "macro", "ondo", "perps",
// "ripple", "rwa", "solana", "tech", "virtuals".
ID TopicEnum `json:"id,required"`
// Human-readable name
Name string `json:"name,required"`
// Feed description
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsListFeedsResponseData) RawJSON ¶
func (r NewsListFeedsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsListFeedsResponseData) UnmarshalJSON ¶
func (r *NewsListFeedsResponseData) UnmarshalJSON(data []byte) error
type NewsListFeedsResponseMeta ¶
type NewsListFeedsResponseMeta struct {
Count int64 `json:"count"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsListFeedsResponseMeta) RawJSON ¶
func (r NewsListFeedsResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsListFeedsResponseMeta) UnmarshalJSON ¶
func (r *NewsListFeedsResponseMeta) UnmarshalJSON(data []byte) error
type NewsListParams ¶
type NewsListParams struct {
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Comma-separated list of topics to filter by. Valid topics: ai, ai_agents, aptos,
// base, bitcoin, crypto, dats, defi, ethereum, hyperliquid, machine_learning,
// macro, ondo, perps, ripple, rwa, solana, tech, virtuals. Default: crypto,
// ai_agents, macro, bitcoin, ethereum, tech
Topics param.Opt[string] `query:"topics,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NewsListParams) URLQuery ¶
func (r NewsListParams) URLQuery() (v url.Values, err error)
URLQuery serializes NewsListParams's query parameters as `url.Values`.
type NewsListResponse ¶
type NewsListResponse struct {
Data []NewsListResponseData `json:"data,required"`
Meta NewsListResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsListResponse) RawJSON ¶
func (r NewsListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsListResponse) UnmarshalJSON ¶
func (r *NewsListResponse) UnmarshalJSON(data []byte) error
type NewsListResponseData ¶
type NewsListResponseData struct {
ID string `json:"id,required"`
// Primary signal/headline
Signal string `json:"signal,required"`
// Unix timestamp (seconds)
Timestamp int64 `json:"timestamp,required"`
TimestampISO time.Time `json:"timestampISO,required" format:"date-time"`
Author string `json:"author"`
Categories []string `json:"categories"`
// Full context
Content string `json:"content"`
NarrativeID string `json:"narrativeId"`
// Sentiment classification for news items
//
// Any of "bullish", "bearish", "neutral".
Sentiment string `json:"sentiment,nullable"`
SentimentValue float64 `json:"sentimentValue"`
Sources []string `json:"sources"`
// Short context summary
Summary string `json:"summary"`
// Related tokens/assets
Tokens []string `json:"tokens"`
TweetURL string `json:"tweetUrl" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Signal respjson.Field
Timestamp respjson.Field
TimestampISO respjson.Field
Author respjson.Field
Categories respjson.Field
Content respjson.Field
NarrativeID respjson.Field
Sentiment respjson.Field
SentimentValue respjson.Field
Sources respjson.Field
Summary respjson.Field
Tokens respjson.Field
TweetURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsListResponseData) RawJSON ¶
func (r NewsListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsListResponseData) UnmarshalJSON ¶
func (r *NewsListResponseData) UnmarshalJSON(data []byte) error
type NewsListResponseMeta ¶
type NewsListResponseMeta struct {
Count int64 `json:"count"`
Limit int64 `json:"limit"`
Topics []TopicEnum `json:"topics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Limit respjson.Field
Topics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NewsListResponseMeta) RawJSON ¶
func (r NewsListResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*NewsListResponseMeta) UnmarshalJSON ¶
func (r *NewsListResponseMeta) UnmarshalJSON(data []byte) error
type NewsService ¶
type NewsService struct {
Options []option.RequestOption
}
NewsService contains methods and other services that help with interacting with the y2 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 NewNewsService method instead.
func NewNewsService ¶
func NewNewsService(opts ...option.RequestOption) (r NewsService)
NewNewsService 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 (*NewsService) GetRecaps ¶
func (r *NewsService) GetRecaps(ctx context.Context, query NewsGetRecapsParams, opts ...option.RequestOption) (res *NewsGetRecapsResponse, err error)
Returns AI-generated recap summaries for specified topics within a given timeframe.
func (*NewsService) List ¶
func (r *NewsService) List(ctx context.Context, query NewsListParams, opts ...option.RequestOption) (res *NewsListResponse, err error)
Returns news items from the GloriaAI terminal cache. Supports filtering by topics and pagination.
func (*NewsService) ListFeeds ¶
func (r *NewsService) ListFeeds(ctx context.Context, opts ...option.RequestOption) (res *NewsListFeedsResponse, err error)
Returns all available news feed topics with descriptions.
type ProfileDeleteResponse ¶ added in v0.4.0
type ProfileDeleteResponse struct {
Data ProfileDeleteResponseData `json:"data,required"`
Meta ProfileDeleteResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileDeleteResponse) RawJSON ¶ added in v0.4.0
func (r ProfileDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileDeleteResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileDeleteResponse) UnmarshalJSON(data []byte) error
type ProfileDeleteResponseData ¶ added in v0.4.0
type ProfileDeleteResponseData struct {
Deleted bool `json:"deleted,required"`
ProfileID string `json:"profileId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Deleted respjson.Field
ProfileID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileDeleteResponseData) RawJSON ¶ added in v0.4.0
func (r ProfileDeleteResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileDeleteResponseData) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileDeleteResponseData) UnmarshalJSON(data []byte) error
type ProfileDeleteResponseMeta ¶ added in v0.4.0
type ProfileDeleteResponseMeta struct {
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileDeleteResponseMeta) RawJSON ¶ added in v0.4.0
func (r ProfileDeleteResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileDeleteResponseMeta) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileDeleteResponseMeta) UnmarshalJSON(data []byte) error
type ProfileListResponse ¶
type ProfileListResponse struct {
Data []ProfileListResponseData `json:"data,required"`
Meta ProfileListResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileListResponse) RawJSON ¶
func (r ProfileListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileListResponse) UnmarshalJSON ¶
func (r *ProfileListResponse) UnmarshalJSON(data []byte) error
type ProfileListResponseData ¶
type ProfileListResponseData struct {
// Any of "email", "sms", "webhook", "both_email_sms".
DeliveryMethod string `json:"deliveryMethod,required"`
IsActive bool `json:"isActive,required"`
ProfileID string `json:"profileId,required"`
SubscribedAt int64 `json:"subscribedAt,required"`
SubscriptionID string `json:"subscriptionId,required"`
Profile ProfileListResponseDataProfile `json:"profile,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeliveryMethod respjson.Field
IsActive respjson.Field
ProfileID respjson.Field
SubscribedAt respjson.Field
SubscriptionID respjson.Field
Profile respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileListResponseData) RawJSON ¶
func (r ProfileListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileListResponseData) UnmarshalJSON ¶
func (r *ProfileListResponseData) UnmarshalJSON(data []byte) error
type ProfileListResponseDataProfile ¶
type ProfileListResponseDataProfile struct {
AudioEnabled bool `json:"audioEnabled"`
Frequency string `json:"frequency"`
Name string `json:"name"`
Status string `json:"status"`
Topic string `json:"topic"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioEnabled respjson.Field
Frequency respjson.Field
Name respjson.Field
Status respjson.Field
Topic respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileListResponseDataProfile) RawJSON ¶
func (r ProfileListResponseDataProfile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileListResponseDataProfile) UnmarshalJSON ¶
func (r *ProfileListResponseDataProfile) UnmarshalJSON(data []byte) error
type ProfileListResponseMeta ¶
type ProfileListResponseMeta struct {
Count int64 `json:"count"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileListResponseMeta) RawJSON ¶
func (r ProfileListResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileListResponseMeta) UnmarshalJSON ¶
func (r *ProfileListResponseMeta) UnmarshalJSON(data []byte) error
type ProfileNewParams ¶ added in v0.4.0
type ProfileNewParams struct {
// Report generation frequency
//
// Any of "daily", "weekly", "biweekly", "monthly".
Frequency ProfileNewParamsFrequency `json:"frequency,omitzero,required"`
// Profile display name
Name string `json:"name,required"`
// Time of day for report generation (HH:mm, UTC)
ScheduleTimeOfDay string `json:"scheduleTimeOfDay,required"`
// Topic description for research
Topic string `json:"topic,required"`
// Custom BLUF report structure template
BlufStructure param.Opt[string] `json:"blufStructure,omitzero"`
// Custom system prompt for the AI analyst
CustomPrompt param.Opt[string] `json:"customPrompt,omitzero"`
// Whether this is a community (public) profile
IsCommunity param.Opt[bool] `json:"isCommunity,omitzero"`
// Day of month for monthly profiles
ScheduleDayOfMonth param.Opt[string] `json:"scheduleDayOfMonth,omitzero"`
// Day of week for weekly/biweekly profiles
ScheduleDayOfWeek param.Opt[string] `json:"scheduleDayOfWeek,omitzero"`
RecursionConfig ProfileNewParamsRecursionConfig `json:"recursionConfig,omitzero"`
// Tags for categorization
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (ProfileNewParams) MarshalJSON ¶ added in v0.4.0
func (r ProfileNewParams) MarshalJSON() (data []byte, err error)
func (*ProfileNewParams) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileNewParams) UnmarshalJSON(data []byte) error
type ProfileNewParamsFrequency ¶ added in v0.4.0
type ProfileNewParamsFrequency string
Report generation frequency
const ( ProfileNewParamsFrequencyDaily ProfileNewParamsFrequency = "daily" ProfileNewParamsFrequencyWeekly ProfileNewParamsFrequency = "weekly" ProfileNewParamsFrequencyBiweekly ProfileNewParamsFrequency = "biweekly" ProfileNewParamsFrequencyMonthly ProfileNewParamsFrequency = "monthly" )
type ProfileNewParamsRecursionConfig ¶ added in v0.4.0
type ProfileNewParamsRecursionConfig struct {
Enabled bool `json:"enabled,required"`
MaxDepth int64 `json:"maxDepth,required"`
// Any of "breadth-first", "depth-first", "hybrid".
Strategy string `json:"strategy,omitzero,required"`
// contains filtered or unexported fields
}
The properties Enabled, MaxDepth, Strategy are required.
func (ProfileNewParamsRecursionConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileNewParamsRecursionConfig) MarshalJSON() (data []byte, err error)
func (*ProfileNewParamsRecursionConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileNewParamsRecursionConfig) UnmarshalJSON(data []byte) error
type ProfileNewResponse ¶ added in v0.4.0
type ProfileNewResponse struct {
Data ProfileNewResponseData `json:"data,required"`
Meta ProfileNewResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileNewResponse) RawJSON ¶ added in v0.4.0
func (r ProfileNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileNewResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileNewResponse) UnmarshalJSON(data []byte) error
type ProfileNewResponseData ¶ added in v0.4.0
type ProfileNewResponseData struct {
// The ID of the newly created profile
ProfileID string `json:"profileId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ProfileID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileNewResponseData) RawJSON ¶ added in v0.4.0
func (r ProfileNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileNewResponseData) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileNewResponseData) UnmarshalJSON(data []byte) error
type ProfileNewResponseMeta ¶ added in v0.4.0
type ProfileNewResponseMeta struct {
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileNewResponseMeta) RawJSON ¶ added in v0.4.0
func (r ProfileNewResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileNewResponseMeta) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileNewResponseMeta) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParams ¶ added in v0.4.0
type ProfilePartialUpdateParams struct {
BlufStructure param.Opt[string] `json:"blufStructure,omitzero"`
// Branding template ID (Pro feature)
BrandingTemplateID param.Opt[string] `json:"brandingTemplateId,omitzero"`
CustomPrompt param.Opt[string] `json:"customPrompt,omitzero"`
IsCommunity param.Opt[bool] `json:"isCommunity,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
ScheduleDayOfMonth param.Opt[string] `json:"scheduleDayOfMonth,omitzero"`
ScheduleDayOfWeek param.Opt[string] `json:"scheduleDayOfWeek,omitzero"`
ScheduleTimeOfDay param.Opt[string] `json:"scheduleTimeOfDay,omitzero"`
Topic param.Opt[string] `json:"topic,omitzero"`
AudioConfig ProfilePartialUpdateParamsAudioConfig `json:"audioConfig,omitzero"`
BudgetConfig ProfilePartialUpdateParamsBudgetConfig `json:"budgetConfig,omitzero"`
// Report generation frequency
//
// Any of "daily", "weekly", "biweekly", "monthly".
Frequency ProfilePartialUpdateParamsFrequency `json:"frequency,omitzero"`
FreshnessConfig ProfilePartialUpdateParamsFreshnessConfig `json:"freshnessConfig,omitzero"`
ModelConfig ProfilePartialUpdateParamsModelConfig `json:"modelConfig,omitzero"`
RecursionConfig ProfilePartialUpdateParamsRecursionConfig `json:"recursionConfig,omitzero"`
SearchConfig ProfilePartialUpdateParamsSearchConfig `json:"searchConfig,omitzero"`
// Profile status
//
// Any of "active", "paused", "cancelled".
Status ProfilePartialUpdateParamsStatus `json:"status,omitzero"`
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (ProfilePartialUpdateParams) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParams) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParams) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsAudioConfig ¶ added in v0.4.0
type ProfilePartialUpdateParamsAudioConfig struct {
Enabled param.Opt[bool] `json:"enabled,omitzero"`
Speed param.Opt[float64] `json:"speed,omitzero"`
VoiceID param.Opt[string] `json:"voiceId,omitzero"`
// contains filtered or unexported fields
}
func (ProfilePartialUpdateParamsAudioConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParamsAudioConfig) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParamsAudioConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParamsAudioConfig) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsBudgetConfig ¶ added in v0.4.0
type ProfilePartialUpdateParamsBudgetConfig struct {
AlertThreshold param.Opt[float64] `json:"alertThreshold,omitzero"`
MaxCostPerReport param.Opt[float64] `json:"maxCostPerReport,omitzero"`
// contains filtered or unexported fields
}
func (ProfilePartialUpdateParamsBudgetConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParamsBudgetConfig) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParamsBudgetConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParamsBudgetConfig) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsFrequency ¶ added in v0.4.0
type ProfilePartialUpdateParamsFrequency string
Report generation frequency
const ( ProfilePartialUpdateParamsFrequencyDaily ProfilePartialUpdateParamsFrequency = "daily" ProfilePartialUpdateParamsFrequencyWeekly ProfilePartialUpdateParamsFrequency = "weekly" ProfilePartialUpdateParamsFrequencyBiweekly ProfilePartialUpdateParamsFrequency = "biweekly" ProfilePartialUpdateParamsFrequencyMonthly ProfilePartialUpdateParamsFrequency = "monthly" )
type ProfilePartialUpdateParamsFreshnessConfig ¶ added in v0.4.0
type ProfilePartialUpdateParamsFreshnessConfig struct {
Enabled param.Opt[bool] `json:"enabled,omitzero"`
MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
PreferRecentSources param.Opt[bool] `json:"preferRecentSources,omitzero"`
RecencyWeight param.Opt[float64] `json:"recencyWeight,omitzero"`
ValidateLinks param.Opt[bool] `json:"validateLinks,omitzero"`
// contains filtered or unexported fields
}
func (ProfilePartialUpdateParamsFreshnessConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParamsFreshnessConfig) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParamsFreshnessConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParamsFreshnessConfig) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsModelConfig ¶ added in v0.4.0
type ProfilePartialUpdateParamsModelConfig struct {
MaxOutputTokens param.Opt[int64] `json:"maxOutputTokens,omitzero"`
ModelID param.Opt[string] `json:"modelId,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// contains filtered or unexported fields
}
func (ProfilePartialUpdateParamsModelConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParamsModelConfig) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParamsModelConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParamsModelConfig) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsRecursionConfig ¶ added in v0.4.0
type ProfilePartialUpdateParamsRecursionConfig struct {
Enabled bool `json:"enabled,required"`
MaxDepth int64 `json:"maxDepth,required"`
// Any of "breadth-first", "depth-first", "hybrid".
Strategy string `json:"strategy,omitzero,required"`
// contains filtered or unexported fields
}
The properties Enabled, MaxDepth, Strategy are required.
func (ProfilePartialUpdateParamsRecursionConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParamsRecursionConfig) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParamsRecursionConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParamsRecursionConfig) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsSearchConfig ¶ added in v0.4.0
type ProfilePartialUpdateParamsSearchConfig struct {
MaxResults param.Opt[int64] `json:"maxResults,omitzero"`
TimeRange param.Opt[string] `json:"timeRange,omitzero"`
Topic param.Opt[string] `json:"topic,omitzero"`
ExcludeDomains []string `json:"excludeDomains,omitzero"`
IncludeDomains []string `json:"includeDomains,omitzero"`
// Any of "basic", "advanced".
SearchDepth string `json:"searchDepth,omitzero"`
// contains filtered or unexported fields
}
func (ProfilePartialUpdateParamsSearchConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateParamsSearchConfig) MarshalJSON() (data []byte, err error)
func (*ProfilePartialUpdateParamsSearchConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateParamsSearchConfig) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateParamsStatus ¶ added in v0.4.0
type ProfilePartialUpdateParamsStatus string
Profile status
const ( ProfilePartialUpdateParamsStatusActive ProfilePartialUpdateParamsStatus = "active" ProfilePartialUpdateParamsStatusPaused ProfilePartialUpdateParamsStatus = "paused" ProfilePartialUpdateParamsStatusCancelled ProfilePartialUpdateParamsStatus = "cancelled" )
type ProfilePartialUpdateResponse ¶ added in v0.4.0
type ProfilePartialUpdateResponse struct {
Data ProfilePartialUpdateResponseData `json:"data,required"`
Meta ProfilePartialUpdateResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfilePartialUpdateResponse) RawJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfilePartialUpdateResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateResponse) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateResponseData ¶ added in v0.4.0
type ProfilePartialUpdateResponseData struct {
ProfileID string `json:"profileId,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ProfileID respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfilePartialUpdateResponseData) RawJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfilePartialUpdateResponseData) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateResponseData) UnmarshalJSON(data []byte) error
type ProfilePartialUpdateResponseMeta ¶ added in v0.4.0
type ProfilePartialUpdateResponseMeta struct {
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfilePartialUpdateResponseMeta) RawJSON ¶ added in v0.4.0
func (r ProfilePartialUpdateResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfilePartialUpdateResponseMeta) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfilePartialUpdateResponseMeta) UnmarshalJSON(data []byte) error
type ProfileService ¶
type ProfileService struct {
Options []option.RequestOption
}
ProfileService contains methods and other services that help with interacting with the y2 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 NewProfileService method instead.
func NewProfileService ¶
func NewProfileService(opts ...option.RequestOption) (r ProfileService)
NewProfileService 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 (*ProfileService) Delete ¶ added in v0.4.0
func (r *ProfileService) Delete(ctx context.Context, profileID string, opts ...option.RequestOption) (res *ProfileDeleteResponse, err error)
Permanently deletes an intelligence profile and all associated subscriptions. Only profiles owned by the authenticated user can be deleted. This action cannot be undone.
func (*ProfileService) List ¶
func (r *ProfileService) List(ctx context.Context, opts ...option.RequestOption) (res *ProfileListResponse, err error)
Returns a list of intelligence profiles the user is subscribed to, including subscription status and delivery preferences.
func (*ProfileService) New ¶ added in v0.4.0
func (r *ProfileService) New(ctx context.Context, body ProfileNewParams, opts ...option.RequestOption) (res *ProfileNewResponse, err error)
Creates a new intelligence profile with the specified configuration. The profile will be owned by the authenticated user and start with `active` status.
func (*ProfileService) PartialUpdate ¶ added in v0.4.0
func (r *ProfileService) PartialUpdate(ctx context.Context, profileID string, body ProfilePartialUpdateParams, opts ...option.RequestOption) (res *ProfilePartialUpdateResponse, err error)
Partially updates an existing intelligence profile. Only the fields included in the request body will be modified; all other fields remain unchanged. Only profiles owned by the authenticated user can be updated.
func (*ProfileService) Update ¶ added in v0.4.0
func (r *ProfileService) Update(ctx context.Context, profileID string, body ProfileUpdateParams, opts ...option.RequestOption) (res *ProfileUpdateResponse, err error)
Replaces all mutable fields of an existing intelligence profile. Only profiles owned by the authenticated user can be updated.
type ProfileUpdateParams ¶ added in v0.4.0
type ProfileUpdateParams struct {
BlufStructure param.Opt[string] `json:"blufStructure,omitzero"`
// Branding template ID (Pro feature)
BrandingTemplateID param.Opt[string] `json:"brandingTemplateId,omitzero"`
CustomPrompt param.Opt[string] `json:"customPrompt,omitzero"`
IsCommunity param.Opt[bool] `json:"isCommunity,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
ScheduleDayOfMonth param.Opt[string] `json:"scheduleDayOfMonth,omitzero"`
ScheduleDayOfWeek param.Opt[string] `json:"scheduleDayOfWeek,omitzero"`
ScheduleTimeOfDay param.Opt[string] `json:"scheduleTimeOfDay,omitzero"`
Topic param.Opt[string] `json:"topic,omitzero"`
AudioConfig ProfileUpdateParamsAudioConfig `json:"audioConfig,omitzero"`
BudgetConfig ProfileUpdateParamsBudgetConfig `json:"budgetConfig,omitzero"`
// Report generation frequency
//
// Any of "daily", "weekly", "biweekly", "monthly".
Frequency ProfileUpdateParamsFrequency `json:"frequency,omitzero"`
FreshnessConfig ProfileUpdateParamsFreshnessConfig `json:"freshnessConfig,omitzero"`
ModelConfig ProfileUpdateParamsModelConfig `json:"modelConfig,omitzero"`
RecursionConfig ProfileUpdateParamsRecursionConfig `json:"recursionConfig,omitzero"`
SearchConfig ProfileUpdateParamsSearchConfig `json:"searchConfig,omitzero"`
// Profile status
//
// Any of "active", "paused", "cancelled".
Status ProfileUpdateParamsStatus `json:"status,omitzero"`
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (ProfileUpdateParams) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParams) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParams) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsAudioConfig ¶ added in v0.4.0
type ProfileUpdateParamsAudioConfig struct {
Enabled param.Opt[bool] `json:"enabled,omitzero"`
Speed param.Opt[float64] `json:"speed,omitzero"`
VoiceID param.Opt[string] `json:"voiceId,omitzero"`
// contains filtered or unexported fields
}
func (ProfileUpdateParamsAudioConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParamsAudioConfig) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParamsAudioConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParamsAudioConfig) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsBudgetConfig ¶ added in v0.4.0
type ProfileUpdateParamsBudgetConfig struct {
AlertThreshold param.Opt[float64] `json:"alertThreshold,omitzero"`
MaxCostPerReport param.Opt[float64] `json:"maxCostPerReport,omitzero"`
// contains filtered or unexported fields
}
func (ProfileUpdateParamsBudgetConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParamsBudgetConfig) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParamsBudgetConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParamsBudgetConfig) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsFrequency ¶ added in v0.4.0
type ProfileUpdateParamsFrequency string
Report generation frequency
const ( ProfileUpdateParamsFrequencyDaily ProfileUpdateParamsFrequency = "daily" ProfileUpdateParamsFrequencyWeekly ProfileUpdateParamsFrequency = "weekly" ProfileUpdateParamsFrequencyBiweekly ProfileUpdateParamsFrequency = "biweekly" ProfileUpdateParamsFrequencyMonthly ProfileUpdateParamsFrequency = "monthly" )
type ProfileUpdateParamsFreshnessConfig ¶ added in v0.4.0
type ProfileUpdateParamsFreshnessConfig struct {
Enabled param.Opt[bool] `json:"enabled,omitzero"`
MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
PreferRecentSources param.Opt[bool] `json:"preferRecentSources,omitzero"`
RecencyWeight param.Opt[float64] `json:"recencyWeight,omitzero"`
ValidateLinks param.Opt[bool] `json:"validateLinks,omitzero"`
// contains filtered or unexported fields
}
func (ProfileUpdateParamsFreshnessConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParamsFreshnessConfig) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParamsFreshnessConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParamsFreshnessConfig) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsModelConfig ¶ added in v0.4.0
type ProfileUpdateParamsModelConfig struct {
MaxOutputTokens param.Opt[int64] `json:"maxOutputTokens,omitzero"`
ModelID param.Opt[string] `json:"modelId,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// contains filtered or unexported fields
}
func (ProfileUpdateParamsModelConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParamsModelConfig) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParamsModelConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParamsModelConfig) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsRecursionConfig ¶ added in v0.4.0
type ProfileUpdateParamsRecursionConfig struct {
Enabled bool `json:"enabled,required"`
MaxDepth int64 `json:"maxDepth,required"`
// Any of "breadth-first", "depth-first", "hybrid".
Strategy string `json:"strategy,omitzero,required"`
// contains filtered or unexported fields
}
The properties Enabled, MaxDepth, Strategy are required.
func (ProfileUpdateParamsRecursionConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParamsRecursionConfig) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParamsRecursionConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParamsRecursionConfig) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsSearchConfig ¶ added in v0.4.0
type ProfileUpdateParamsSearchConfig struct {
MaxResults param.Opt[int64] `json:"maxResults,omitzero"`
TimeRange param.Opt[string] `json:"timeRange,omitzero"`
Topic param.Opt[string] `json:"topic,omitzero"`
ExcludeDomains []string `json:"excludeDomains,omitzero"`
IncludeDomains []string `json:"includeDomains,omitzero"`
// Any of "basic", "advanced".
SearchDepth string `json:"searchDepth,omitzero"`
// contains filtered or unexported fields
}
func (ProfileUpdateParamsSearchConfig) MarshalJSON ¶ added in v0.4.0
func (r ProfileUpdateParamsSearchConfig) MarshalJSON() (data []byte, err error)
func (*ProfileUpdateParamsSearchConfig) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateParamsSearchConfig) UnmarshalJSON(data []byte) error
type ProfileUpdateParamsStatus ¶ added in v0.4.0
type ProfileUpdateParamsStatus string
Profile status
const ( ProfileUpdateParamsStatusActive ProfileUpdateParamsStatus = "active" ProfileUpdateParamsStatusPaused ProfileUpdateParamsStatus = "paused" ProfileUpdateParamsStatusCancelled ProfileUpdateParamsStatus = "cancelled" )
type ProfileUpdateResponse ¶ added in v0.4.0
type ProfileUpdateResponse struct {
Data ProfileUpdateResponseData `json:"data,required"`
Meta ProfileUpdateResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileUpdateResponse) RawJSON ¶ added in v0.4.0
func (r ProfileUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileUpdateResponse) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateResponse) UnmarshalJSON(data []byte) error
type ProfileUpdateResponseData ¶ added in v0.4.0
type ProfileUpdateResponseData struct {
ProfileID string `json:"profileId,required"`
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ProfileID respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileUpdateResponseData) RawJSON ¶ added in v0.4.0
func (r ProfileUpdateResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileUpdateResponseData) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateResponseData) UnmarshalJSON(data []byte) error
type ProfileUpdateResponseMeta ¶ added in v0.4.0
type ProfileUpdateResponseMeta struct {
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProfileUpdateResponseMeta) RawJSON ¶ added in v0.4.0
func (r ProfileUpdateResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProfileUpdateResponseMeta) UnmarshalJSON ¶ added in v0.4.0
func (r *ProfileUpdateResponseMeta) UnmarshalJSON(data []byte) error
type ReportGetAudioParams ¶
type ReportGetAudioParams struct {
// If true, returns 302 redirect to audio CDN URL
Redirect param.Opt[bool] `query:"redirect,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ReportGetAudioParams) URLQuery ¶
func (r ReportGetAudioParams) URLQuery() (v url.Values, err error)
URLQuery serializes ReportGetAudioParams's query parameters as `url.Values`.
type ReportGetAudioResponse ¶
type ReportGetAudioResponse struct {
Data AudioMetadata `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportGetAudioResponse) RawJSON ¶
func (r ReportGetAudioResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetAudioResponse) UnmarshalJSON ¶
func (r *ReportGetAudioResponse) UnmarshalJSON(data []byte) error
type ReportGetResponse ¶
type ReportGetResponse struct {
Data ReportGetResponseData `json:"data,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportGetResponse) RawJSON ¶
func (r ReportGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetResponse) UnmarshalJSON ¶
func (r *ReportGetResponse) UnmarshalJSON(data []byte) error
type ReportGetResponseData ¶
type ReportGetResponseData struct {
ID string `json:"id,required"`
Content ReportGetResponseDataContent `json:"content,required"`
GeneratedAt int64 `json:"generatedAt,required"`
GeneratedAtISO time.Time `json:"generatedAtISO,required" format:"date-time"`
ProfileID string `json:"profileId,required"`
Audio AudioMetadata `json:"audio,nullable"`
Metadata ReportGetResponseDataMetadata `json:"metadata"`
ProfileName string `json:"profileName"`
ProfileTopic string `json:"profileTopic"`
Sources []string `json:"sources" format:"uri"`
Topic string `json:"topic"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Content respjson.Field
GeneratedAt respjson.Field
GeneratedAtISO respjson.Field
ProfileID respjson.Field
Audio respjson.Field
Metadata respjson.Field
ProfileName respjson.Field
ProfileTopic respjson.Field
Sources respjson.Field
Topic respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportGetResponseData) RawJSON ¶
func (r ReportGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetResponseData) UnmarshalJSON ¶
func (r *ReportGetResponseData) UnmarshalJSON(data []byte) error
type ReportGetResponseDataContent ¶
type ReportGetResponseDataContent struct {
// Full HTML content
HTML string `json:"html"`
// SMS-friendly summary
Summary string `json:"summary"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HTML respjson.Field
Summary respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportGetResponseDataContent) RawJSON ¶
func (r ReportGetResponseDataContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetResponseDataContent) UnmarshalJSON ¶
func (r *ReportGetResponseDataContent) UnmarshalJSON(data []byte) error
type ReportGetResponseDataMetadata ¶
type ReportGetResponseDataMetadata struct {
// Source freshness validation results
FreshnessMetadata ReportGetResponseDataMetadataFreshnessMetadata `json:"freshnessMetadata"`
Model string `json:"model"`
// Metadata about recursive research execution
RecursionMetadata ReportGetResponseDataMetadataRecursionMetadata `json:"recursionMetadata"`
TotalCost float64 `json:"totalCost"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FreshnessMetadata respjson.Field
Model respjson.Field
RecursionMetadata respjson.Field
TotalCost respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportGetResponseDataMetadata) RawJSON ¶
func (r ReportGetResponseDataMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetResponseDataMetadata) UnmarshalJSON ¶
func (r *ReportGetResponseDataMetadata) UnmarshalJSON(data []byte) error
type ReportGetResponseDataMetadataFreshnessMetadata ¶
type ReportGetResponseDataMetadataFreshnessMetadata struct {
AccessibleLinks int64 `json:"accessibleLinks"`
// Average source age in milliseconds
AverageAgeMs int64 `json:"averageAgeMs"`
// Overall freshness score (higher = fresher)
FreshnessScore float64 `json:"freshnessScore"`
StaleSourcesCount int64 `json:"staleSourcesCount"`
TotalLinks int64 `json:"totalLinks"`
ValidatedAt int64 `json:"validatedAt"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccessibleLinks respjson.Field
AverageAgeMs respjson.Field
FreshnessScore respjson.Field
StaleSourcesCount respjson.Field
TotalLinks respjson.Field
ValidatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Source freshness validation results
func (ReportGetResponseDataMetadataFreshnessMetadata) RawJSON ¶
func (r ReportGetResponseDataMetadataFreshnessMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetResponseDataMetadataFreshnessMetadata) UnmarshalJSON ¶
func (r *ReportGetResponseDataMetadataFreshnessMetadata) UnmarshalJSON(data []byte) error
type ReportGetResponseDataMetadataRecursionMetadata ¶
type ReportGetResponseDataMetadataRecursionMetadata struct {
// Recursion depth achieved (0 = standard report)
Depth int64 `json:"depth"`
// Reason if fallback to standard generation occurred
FallbackReason string `json:"fallbackReason"`
LayersProcessed int64 `json:"layersProcessed"`
// Any of "breadth-first", "depth-first", "hybrid".
Strategy string `json:"strategy"`
SubtopicsGenerated []string `json:"subtopicsGenerated"`
TotalSourcesCollected int64 `json:"totalSourcesCollected"`
TotalTimeMs int64 `json:"totalTimeMs"`
UniqueSourcesAggregated int64 `json:"uniqueSourcesAggregated"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Depth respjson.Field
FallbackReason respjson.Field
LayersProcessed respjson.Field
Strategy respjson.Field
SubtopicsGenerated respjson.Field
TotalSourcesCollected respjson.Field
TotalTimeMs respjson.Field
UniqueSourcesAggregated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metadata about recursive research execution
func (ReportGetResponseDataMetadataRecursionMetadata) RawJSON ¶
func (r ReportGetResponseDataMetadataRecursionMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportGetResponseDataMetadataRecursionMetadata) UnmarshalJSON ¶
func (r *ReportGetResponseDataMetadataRecursionMetadata) UnmarshalJSON(data []byte) error
type ReportListParams ¶
type ReportListParams struct {
// Maximum number of reports to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter reports by profile ID
ProfileID param.Opt[string] `query:"profileId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ReportListParams) URLQuery ¶
func (r ReportListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ReportListParams's query parameters as `url.Values`.
type ReportListResponse ¶
type ReportListResponse struct {
Data []ReportListResponseData `json:"data,required"`
Meta ReportListResponseMeta `json:"meta,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportListResponse) RawJSON ¶
func (r ReportListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportListResponse) UnmarshalJSON ¶
func (r *ReportListResponse) UnmarshalJSON(data []byte) error
type ReportListResponseData ¶
type ReportListResponseData struct {
// Report ID (Convex document ID)
ID string `json:"id,required"`
// Unix timestamp (milliseconds)
GeneratedAt int64 `json:"generatedAt,required"`
// ISO 8601 timestamp
GeneratedAtISO time.Time `json:"generatedAtISO,required" format:"date-time"`
// Profile ID this report belongs to
ProfileID string `json:"profileId,required"`
// Whether audio narration is available
HasAudio bool `json:"hasAudio"`
// LLM model used for generation
Model string `json:"model"`
// Brief SMS-friendly summary
Summary string `json:"summary"`
// Report topic
Topic string `json:"topic"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
GeneratedAt respjson.Field
GeneratedAtISO respjson.Field
ProfileID respjson.Field
HasAudio respjson.Field
Model respjson.Field
Summary respjson.Field
Topic respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportListResponseData) RawJSON ¶
func (r ReportListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportListResponseData) UnmarshalJSON ¶
func (r *ReportListResponseData) UnmarshalJSON(data []byte) error
type ReportListResponseMeta ¶
type ReportListResponseMeta struct {
Count int64 `json:"count"`
Limit int64 `json:"limit"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Limit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ReportListResponseMeta) RawJSON ¶
func (r ReportListResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ReportListResponseMeta) UnmarshalJSON ¶
func (r *ReportListResponseMeta) UnmarshalJSON(data []byte) error
type ReportService ¶
type ReportService struct {
Options []option.RequestOption
}
ReportService contains methods and other services that help with interacting with the y2 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 NewReportService method instead.
func NewReportService ¶
func NewReportService(opts ...option.RequestOption) (r ReportService)
NewReportService 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 (*ReportService) Get ¶
func (r *ReportService) Get(ctx context.Context, reportID string, opts ...option.RequestOption) (res *ReportGetResponse, err error)
Returns the full content of a specific intelligence report, including HTML content, sources, and audio metadata.
func (*ReportService) GetAudio ¶
func (r *ReportService) GetAudio(ctx context.Context, reportID string, query ReportGetAudioParams, opts ...option.RequestOption) (res *ReportGetAudioResponse, err error)
Returns audio file metadata or redirects to the CDN URL. Requires the `reports:audio` scope.
func (*ReportService) List ¶
func (r *ReportService) List(ctx context.Context, query ReportListParams, opts ...option.RequestOption) (res *ReportListResponse, err error)
Returns a list of reports for the user's subscribed profiles. Results are sorted by generation date (newest first).
type TimeframeEnum ¶
type TimeframeEnum string
Time period for recap data
const ( TimeframeEnum12h TimeframeEnum = "12h" TimeframeEnum24h TimeframeEnum = "24h" TimeframeEnum3d TimeframeEnum = "3d" TimeframeEnum7d TimeframeEnum = "7d" )
type TopicEnum ¶
type TopicEnum string
Available news feed topics from GloriaAI
const ( TopicEnumAI TopicEnum = "ai" TopicEnumAIAgents TopicEnum = "ai_agents" TopicEnumAptos TopicEnum = "aptos" TopicEnumBase TopicEnum = "base" TopicEnumBitcoin TopicEnum = "bitcoin" TopicEnumCrypto TopicEnum = "crypto" TopicEnumDats TopicEnum = "dats" TopicEnumDefi TopicEnum = "defi" TopicEnumEthereum TopicEnum = "ethereum" TopicEnumHyperliquid TopicEnum = "hyperliquid" TopicEnumMachineLearning TopicEnum = "machine_learning" TopicEnumMacro TopicEnum = "macro" TopicEnumOndo TopicEnum = "ondo" TopicEnumPerps TopicEnum = "perps" TopicEnumRipple TopicEnum = "ripple" TopicEnumRwa TopicEnum = "rwa" TopicEnumSolana TopicEnum = "solana" TopicEnumTech TopicEnum = "tech" TopicEnumVirtuals TopicEnum = "virtuals" )
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
|
|
|
shared
|
|