File size: 708 Bytes
c01955c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

from utils.asyncHandler import asyncHandler
from src.Agents.prompts import QuestionGeneraterPrompt
from src.Agents.llm.llm_loader import llm

from src.Agents.tools.taivily_search_tool import Taivily_search

from src.Agents.models.interview_model import ChatState
from langsmith import traceable

taivily_search=Taivily_search()._tavily_search()

tools=[taivily_search]


@asyncHandler
@traceable(name="question_Generator",tags=["interview:question_generator"])
async def generate_questions(state:ChatState):
    prompt = QuestionGeneraterPrompt.format(topic=state.topic)
    llm_with_tools = llm.bind_tools(tools=tools)
    res = llm_with_tools.invoke(prompt)

    return {'questions_generated':res.content}