QueryEnhancedResponseGenerator.predict:v0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import weave
from typing import List
from typing import Dict
@weave.op()
async def predict(
self,
query: str,
context: List[Dict[str, any]],
language: str,
intents: List[str],
):
"""
Predict the response for the given query, context, language, and intents.
Args:
query (str): The user's query.
context (List[Dict[str, any]]): A list of dictionaries containing context data.
language (str): The language to be used in the response.
intents (List[str]): A list of intents to be considered in the response.
Returns:
str: The predicted response from the chat model.
"""
return await self.generate_response(query, context, language, intents)