diff --git a/src/gen/feeds/FeedsApi.ts b/src/gen/feeds/FeedsApi.ts index 7cfcf10..58c591b 100644 --- a/src/gen/feeds/FeedsApi.ts +++ b/src/gen/feeds/FeedsApi.ts @@ -702,6 +702,7 @@ export class FeedsApi { user_id?: string; language?: string; translate_text?: boolean; + include_top_level_comment_count?: boolean; }): Promise> { const queryParams = { comment_sort: request?.comment_sort, @@ -710,6 +711,7 @@ export class FeedsApi { user_id: request?.user_id, language: request?.language, translate_text: request?.translate_text, + include_top_level_comment_count: request?.include_top_level_comment_count, }; const pathParams = { id: request?.id, @@ -1111,6 +1113,7 @@ export class FeedsApi { limit?: number; prev?: string; next?: string; + include_top_level_comment_count?: boolean; }): Promise> { const queryParams = { object_id: request?.object_id, @@ -1125,6 +1128,7 @@ export class FeedsApi { limit: request?.limit, prev: request?.prev, next: request?.next, + include_top_level_comment_count: request?.include_top_level_comment_count, }; const response = await this.apiClient.sendRequest( diff --git a/src/gen/model-decoders/decoders.ts b/src/gen/model-decoders/decoders.ts index 6d4065d..77a356c 100644 --- a/src/gen/model-decoders/decoders.ts +++ b/src/gen/model-decoders/decoders.ts @@ -3292,6 +3292,15 @@ decoders['IngressStoppedEvent'] = (input?: { [key: string]: any }) => { return decode(typeMappings, input); }; +decoders['IntentDetectedEvent'] = (input?: { [key: string]: any }) => { + const typeMappings: TypeMapping = { + created_at: { type: 'DatetimeType', isSingle: true }, + + received_at: { type: 'DatetimeType', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders['KickedUserEvent'] = (input?: { [key: string]: any }) => { const typeMappings: TypeMapping = { created_at: { type: 'DatetimeType', isSingle: true }, diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index fed48cd..d90b687 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -815,6 +815,10 @@ export interface ActivityResponse { * Text content of the activity */ text?: string; + /** + * Number of top-level comments (comments directly on the activity, excluding replies). Only returned by GetActivity when include_top_level_comment_count=true; never set on feed reads or events. Same status/deletion rules as comment_count; not adjusted per viewer. + */ + top_level_comment_count?: number; /** * If visibility is 'tag', this is the tag name */ @@ -882,6 +886,10 @@ export interface ActivitySelectorConfig { * Minimum popularity threshold. For the 'popular' selector, omit to use the default (5); values below 1 are rejected */ min_popularity?: number; + /** + * Maximum number of candidate activities this selector contributes to a ranked feed (1-1000). Omit to use the default ranking buffer. Only supported on the popular, proximity, interest and query selectors, and ignored on feeds without ranking + */ + ranking_candidate_limit?: number; /** * Sort parameters for activity selection */ @@ -918,6 +926,10 @@ export interface ActivitySelectorConfigResponse { * Minimum popularity threshold. For the 'popular' selector, values below 1 are normalized to the default (5) at read time. */ min_popularity?: number; + /** + * Maximum number of candidate activities this selector contributes to a ranked feed + */ + ranking_candidate_limit?: number; /** * Sort parameters for activity selection */ @@ -5563,6 +5575,22 @@ export interface CheckResponse { * Status of the moderation check (completed or pending) */ status: string; + /** + * Intent topic label matched by this request's text (test mode only; omitted when no topic matched) + */ + intent_matched_topic?: string; + /** + * Stage 2 conversation score (0-100) computed synchronously against this request's texts (test mode only). Omitted -- not zero -- when intent_matched_topic is set but scoring could not be completed (matched topic disabled/removed, or the scoring call itself failed); only present when a real score was computed + */ + intent_score?: number; + /** + * The matched topic's configured score_threshold, for comparison against intent_score (test mode only). Same omitted-not-zero rule as intent_score + */ + intent_score_threshold?: number; + /** + * Whether intent_score clears intent_score_threshold, i.e. whether this would fire moderation.intent_detected in production (test mode only). Same omitted-not-zero rule as intent_score + */ + intent_would_fire?: boolean; /** * ID of the running moderation task */ @@ -6245,6 +6273,7 @@ export interface ConfigResponse { automod_toxicity_config?: AutomodToxicityConfig; block_list_config?: BlockListConfig; flood_config?: FloodConfig; + intent_config?: IntentConfigResponse; llm_config?: LLMConfig; velocity_filter_config?: VelocityFilterConfig; video_call_rule_config?: VideoCallRuleConfig; @@ -10161,6 +10190,10 @@ export interface GetCommentResponse { } export interface GetCommentsResponse { + /** + * Total number of comments on the object, including replies at every depth + */ + comment_count: number; duration: string; /** * Sort order used for the comments (first, last, top, best, controversial) @@ -10172,6 +10205,10 @@ export interface GetCommentsResponse { comments: Array; next?: string; prev?: string; + /** + * Number of comments directly on the object, excluding replies. Independent of depth, replies_limit and id_around, and not adjusted per viewer. Only present when include_top_level_comment_count is set + */ + top_level_comment_count?: number; } export interface GetConfigResponse { @@ -11353,6 +11390,136 @@ export interface InsertActionLogResponse { duration: string; } +export interface IntentBufferedItem { + /** + * The ID of the user who authored the buffered message or comment + */ + author_user_id: string; + /** + * When the buffered message or comment was created + */ + created_at: Date; + /** + * The ID of the buffered message or comment + */ + id: string; + /** + * The text of the buffered message or comment + */ + text: string; +} + +export interface IntentConfigRequest { + /** + * Topics to classify conversation text against (max 20, labels must be unique) + */ + topics?: Array; +} + +export interface IntentConfigResponse { + /** + * Topics conversation text is classified against + */ + topics: Array; +} + +export interface IntentDetectedEvent { + /** + * The channel CID (chat) or feed ID (feeds) the buffered conversation belongs to + */ + conversation_id: string; + created_at: Date; + /** + * The ID of the most recently buffered entity + */ + entity_id: string; + /** + * The type of the most recently buffered entity (chat message or feed comment) + */ + entity_type: string; + /** + * The configured intent topic label that started the buffer + */ + matched_topic: string; + /** + * The Stage 2 conversation score (0-100) that cleared score_threshold + */ + score: number; + /** + * The ID of the user whose conversation was scored + */ + user_id: string; + /** + * The buffered items that were scored, in the order they were captured + */ + items: Array; + custom: Record; + type: string; + received_at?: Date; +} + +export interface IntentTopicRequest { + /** + * Unique topic label (e.g. purchase_intent) + */ + label: string; + /** + * How long the buffer collects items before scoring runs + */ + analysis_cooldown_seconds?: number; + /** + * Optional description used in the classification prompt; the label alone is used when empty + */ + description?: string; + /** + * Whether this topic is evaluated + */ + enabled?: boolean; + /** + * Items buffered per conversation before scoring runs early + */ + max_captured_items?: number; + /** + * Suppresses this topic for a user and conversation after it fires; 0 uses the default + */ + refire_cooldown_seconds?: number; + /** + * Conversation score (0-100) required to fire moderation.intent_detected + */ + score_threshold?: number; +} + +export interface IntentTopicResponse { + /** + * How long the buffer collects items before scoring runs + */ + analysis_cooldown_seconds: number; + /** + * Whether this topic is evaluated + */ + enabled: boolean; + /** + * Unique topic label (e.g. purchase_intent) + */ + label: string; + /** + * Items buffered per conversation before scoring runs early + */ + max_captured_items: number; + /** + * Conversation score (0-100) required to fire moderation.intent_detected + */ + score_threshold: number; + /** + * Optional description used in the classification prompt; the label alone is used when empty + */ + description?: string; + /** + * Suppresses this topic for a user and conversation after it fires; 0 uses the default + */ + refire_cooldown_seconds?: number; +} + export interface InterestTagResponse { /** * Lifetime number of distinct reacted-to activities tagged with this value, without decay; 0 for manually set tags @@ -22028,6 +22195,7 @@ export interface UpsertConfigRequest { bodyguard_config?: AITextConfig; flood_config?: FloodConfig; google_vision_config?: GoogleVisionConfig; + intent_config?: IntentConfigRequest; llm_config?: LLMConfig; rule_builder_config?: RuleBuilderConfig; /** @@ -23215,6 +23383,7 @@ export type WHEvent = | ({ type: 'moderation.image_analysis.complete'; } & ModerationImageAnalysisCompleteEvent) + | ({ type: 'moderation.intent_detected' } & IntentDetectedEvent) | ({ type: 'moderation.mark_reviewed' } & ModerationMarkReviewedEvent) | ({ type: 'moderation.text_analysis.complete'; diff --git a/src/gen/moderation/ModerationApi.ts b/src/gen/moderation/ModerationApi.ts index acb3a3e..4d26e8a 100644 --- a/src/gen/moderation/ModerationApi.ts +++ b/src/gen/moderation/ModerationApi.ts @@ -518,6 +518,7 @@ export class ModerationApi { bodyguard_config: request?.bodyguard_config, flood_config: request?.flood_config, google_vision_config: request?.google_vision_config, + intent_config: request?.intent_config, llm_config: request?.llm_config, rule_builder_config: request?.rule_builder_config, user: request?.user,