Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / news / src / main / java / com / vayunmathur / news / intents / ReadArticleIntent.kt

ReadArticleIntent.kt14 lines · 685 BRaw
1package com.vayunmathur.news.intents
2
3import com.vayunmathur.library.intents.news.NewsArticleQuery
4import com.vayunmathur.library.intents.news.NewsArticleExcerptData
5import com.vayunmathur.library.util.AssistantIntent
6
7/** Assistant tool: One capped page of an extracted article (`news_read_article`). Validated and clamped provider-side in [NewsAssistantBackend]. */
8class ReadArticleIntent : AssistantIntent<NewsArticleQuery, NewsArticleExcerptData>(
9 NewsArticleQuery.serializer(),
10 NewsArticleExcerptData.serializer(),
11) {
12 override suspend fun performCalculation(input: NewsArticleQuery): NewsArticleExcerptData =
13 readArticle(input, newsAssistantBackend(this))
14}