from pydantic import BaseModel
class feedback(BaseModel):
query_id: int
content: str
def moe(query: str, query_id: int, response: str) -> str:
moe_prompt = f"""
User query: {query}
query_id: {query_id}
The following is an assistant response to the original user query. Analyse the response, then critizise the response by discussing both strength and weakness of the response.
{response}
"""
return moe_prompt
def moe_select_candiadate(query: str, candidates_with_feedback: list[str]) -> str:
select_prompt = f"""
From the following responses for the user query: {query}
select the best fitting candidate and formulate a final anser for the user.
{candidates_with_feedback[0].message.content}
{candidates_with_feedback[1].message.content}
{candidates_with_feedback[2].message.content}
"""
return select_prompt