Spaces:
Sleeping
Sleeping
Download python_backend/src/Agents/graphs/resume_graph_builder.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/Agents/graphs/resume_graph_builder.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/src/Agents/graphs/resume_graph_builder.py
-
curl -L -o resume_graph_builder.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/Agents/graphs/resume_graph_builder.py
1.06 kB
| import sys | |
| import logging | |
| from langgraph.graph import START, END, StateGraph | |
| from exception import MyException | |
| import sys | |
| # ------------------- Schemas ------------------- | |
| from src.Agents.models.Resume_model import ResumeState | |
| # ------------------- LLM ------------------- | |
| from src.Agents.nodes.resume_builder import resume_maker | |
| graph = StateGraph(state_schema=ResumeState) | |
| graph.add_node("resume_maker", resume_maker) | |
| graph.add_edge(START, "resume_maker") | |
| graph.add_edge("resume_maker", END) | |
| graph = graph.compile() | |
| try: | |
| with open("resume_graph.png","wb") as f: | |
| f.write(graph.get_graph().draw_mermaid_png()) | |
| except Exception as e: | |
| raise MyException(e,sys) | |
| # ------------------- Main ------------------- | |
| async def create_resume_schema(userDetails: str): | |
| logging.info("Entering create_resume_schema") | |
| try: | |
| final_state = await graph.ainvoke({"userDetails": userDetails}) | |
| logging.info("Exiting create_resume_schema") | |
| return final_state | |
| except Exception as e: | |
| raise MyException(e, sys) | |