SimpleResponseGenerator.predict:v0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import weave
from typing import List
from typing import Dict
@weave.op()
def predict(self, query: str, context: List[Dict[str, any]]):
"""
Predict the response for the given query and context.
Args:
query (str): The user's query.
context (List[Dict[str, any]]): A list of dictionaries containing context data.
Returns:
str: The predicted response from the chat model.
"""
return self.generate_response(query, context)