|
24 | 24 | if coverage is not None: |
25 | 25 | coverage.process_startup() |
26 | 26 |
|
27 | | -from typeagent.aitools import embeddings, utils |
28 | | -from typeagent.knowpro import answers, query, searchlang |
| 27 | +from typeagent.aitools import utils |
| 28 | +from typeagent.aitools.embeddings import IEmbeddingModel |
| 29 | +from typeagent.knowpro import answers, searchlang |
29 | 30 | from typeagent.knowpro.answer_response_schema import AnswerResponse |
30 | 31 | from typeagent.knowpro.convsettings import ConversationSettings |
| 32 | +from typeagent.knowpro.query import QueryEvalContext |
31 | 33 | from typeagent.knowpro.search_query_schema import SearchQuery |
32 | | -from typeagent.podcasts import podcast |
| 34 | +from typeagent.podcasts.podcast import Podcast, PodcastMessage |
33 | 35 | from typeagent.storage.memory.semrefindex import TermToSemanticRefIndex |
34 | 36 | from typeagent.storage.utils import create_storage_provider |
35 | 37 |
|
@@ -103,10 +105,8 @@ async def complete( |
103 | 105 | class ProcessingContext: |
104 | 106 | lang_search_options: searchlang.LanguageSearchOptions |
105 | 107 | answer_context_options: answers.AnswerContextOptions |
106 | | - query_context: query.QueryEvalContext[ |
107 | | - podcast.PodcastMessage, TermToSemanticRefIndex |
108 | | - ] |
109 | | - embedding_model: embeddings.IEmbeddingModel |
| 108 | + query_context: QueryEvalContext[PodcastMessage, TermToSemanticRefIndex] |
| 109 | + embedding_model: IEmbeddingModel |
110 | 110 | query_translator: typechat.TypeChatJsonTranslator[SearchQuery] |
111 | 111 | answer_translator: typechat.TypeChatJsonTranslator[AnswerResponse] |
112 | 112 |
|
@@ -136,7 +136,7 @@ async def make_context( |
136 | 136 | settings.message_text_index_settings, |
137 | 137 | settings.related_term_index_settings, |
138 | 138 | dbname, |
139 | | - podcast.PodcastMessage, |
| 139 | + PodcastMessage, |
140 | 140 | ) |
141 | 141 |
|
142 | 142 | lang_search_options = searchlang.LanguageSearchOptions( |
@@ -175,20 +175,20 @@ async def load_podcast_database_or_index( |
175 | 175 | settings: ConversationSettings, |
176 | 176 | dbname: str | None = None, |
177 | 177 | podcast_index: str | None = None, |
178 | | -) -> query.QueryEvalContext[podcast.PodcastMessage, Any]: |
| 178 | +) -> QueryEvalContext[PodcastMessage, Any]: |
179 | 179 | if dbname is not None: |
180 | 180 | # Load from SQLite database |
181 | | - conversation = await podcast.Podcast.create(settings) |
| 181 | + conversation = await Podcast.create(settings) |
182 | 182 | elif podcast_index is not None: |
183 | 183 | # Load from JSON index files |
184 | | - conversation = await podcast.Podcast.read_from_file(podcast_index, settings) |
| 184 | + conversation = await Podcast.read_from_file(podcast_index, settings) |
185 | 185 | else: |
186 | 186 | raise ValueError( |
187 | 187 | "Either --database or --podcast-index must be specified. " |
188 | 188 | "Use --podcast-index to specify the path to podcast index files " |
189 | 189 | f"(e.g., '{_EXAMPLE_PODCAST_INDEX}')." |
190 | 190 | ) |
191 | | - return query.QueryEvalContext(conversation) |
| 191 | + return QueryEvalContext(conversation) |
192 | 192 |
|
193 | 193 |
|
194 | 194 | # Create an MCP server |
|
0 commit comments