Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / news / src / main / java / com / vayunmathur / news / intents / ReadArticleIntent.kt
ReadArticleIntent.kt14 lines · 685 BRaw
| 1 | package com.vayunmathur.news.intents |
| 2 | |
| 3 | import com.vayunmathur.library.intents.news.NewsArticleQuery |
| 4 | import com.vayunmathur.library.intents.news.NewsArticleExcerptData |
| 5 | import 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]. */ |
| 8 | class 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 | } |