Spaces:
Sleeping
Sleeping
John Segreto commited on
Commit ·
9b6d10b
1
Parent(s): fdd686d
Add application
Browse filesFiles changed (3)
- Ewriter_Examples.pyAdded+273
- app.pyAdded+803
- requirements.txtAdded+238
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273#%% [code]import warningswarnings.filterwarnings("ignore", message=".*TqdmWarning.*")from dotenv import load_dotenv_ = load_dotenv()
from langgraph.graph import StateGraph, ENDfrom typing import TypedDict, Annotated, Listimport operatorfrom langgraph.checkpoint.sqlite import SqliteSaverfrom langchain_core.messages import SystemMessage, HumanMessagefrom langchain_openai import ChatOpenAIfrom pydantic import BaseModelfrom tavily import TavilyClientimport osimport sqlite3from langchain.prompts import FewShotPromptTemplate, PromptTemplate
legal_article_outline = [{"input":"Staffing applications used in healthcare industry. The risks involved in using them from a legal perspective.", "output": """### The Legal Risks of Staffing Applications in Healthcare: What Every Provider Should Know
#### I. Introduction: The Rise of Staffing Applications in Healthcare (Hook)- **Opening Statement:** Staffing applications have revolutionized the healthcare industry, offering on-demand staffing solutions for hospitals, clinics, and long-term care facilities. - **Problem Statement:** But while these apps promise efficiency, they also come with hidden legal risks that can expose healthcare providers to liability, compliance violations, and even lawsuits. - **Why This Matters:** Healthcare providers must understand these risks before integrating staffing apps into their operations. - **Call-to-Action:** This article will outline the major legal concerns, real-world cases, and best practices to protect your organization.
#### II. The Legal Risks of Using Healthcare Staffing Applications##### A. Compliance Issues: Are You Violating Employment Laws?- **Independent Contractor vs. Employee Classification** - Many staffing apps classify workers as independent contractors. - Misclassification can result in lawsuits and penalties under labor laws (e.g., FLSA, IRS rules). - **State-Specific Employment Regulations** - Some states have strict worker classification laws (e.g., California’s AB5). - Employers must ensure compliance with both federal and state labor laws.
##### B. Liability Concerns: Who is Responsible for Malpractice or Misconduct?- **Negligence in Hiring:** - If an app fails to conduct adequate background checks, facilities using these workers could be held liable. - **Vicarious Liability Risks:** - If a contracted healthcare worker commits malpractice, **who is legally responsible?** - Case study example: A hospital was sued after a temp nurse hired via an app administered the wrong medication.
##### C. Data Privacy & HIPAA Compliance: Are You at Risk?- **How Staffing Apps Handle Sensitive Data** - Apps store and transmit sensitive healthcare worker and patient information. - **Potential Data Breaches & Legal Consequences** - HIPAA violations can result in **hefty fines and reputational damage**. - Best practices for ensuring data security and compliance.
#### III. How to Protect Your Healthcare Organization##### A. Vetting Staffing Applications Before Use- **What legal teams should review before signing contracts with staffing apps**- **Key contract clauses to negotiate** (e.g., indemnification, liability limitations)
##### B. Internal Policies to Reduce Risk- **Training staff on proper use of staffing applications** - **Implementing a risk assessment plan before adopting new technology**
##### C. When to Consult a Healthcare Attorney- **How an experienced healthcare attorney can help providers** - **Why proactive legal planning can save organizations from costly litigation**
#### IV. Conclusion: The Right Approach to Staffing Applications- **Summary of Key Takeaways** - Staffing apps offer convenience but **come with serious legal risks**. - Compliance, liability, and data security must be **top priorities** for healthcare providers. - **Final Call-to-Action: Contact a Lawyer Before It's Too Late** - If your organization is considering or already using staffing applications, **consulting a healthcare attorney is essential**. - Contact [Attorney’s Name] today to discuss how to mitigate risks and protect your practice."""},{"input" : "State Antitrust Enforcement in the Healthcare Industry", "output": """### The Rise of State Antitrust Enforcement in Healthcare: What You Need to Know
#### I. Introduction: The Shift from Federal to State-Level Antitrust Oversight- **Opening Statement:** Federal antitrust enforcement remains uncertain, with unclear outcomes for the new HSR rules, merger guidelines, and existing enforcement actions. - **Problem Statement:** In contrast, **state antitrust enforcement** in the healthcare sector has taken a much clearer and more aggressive stance. - **Why This Matters:** State regulators are no longer waiting for federal agencies like the **FTC** or **DOJ** to take the lead—many have implemented **state-specific transaction notification laws** targeting healthcare transactions. - **Call-to-Action:** This article will explore the growing impact of state-level antitrust enforcement, key legal developments, and what healthcare entities should do to stay compliant.
#### II. The Growing Role of State Antitrust Enforcement in Healthcare##### A. Why Are States Increasing Their Role?- **Local Impact of Healthcare Transactions** - Healthcare delivery is inherently local, making state enforcement a natural fit. - States prioritize protecting their citizens from perceived anticompetitive consolidation. - **Declining Federal Leadership in Antitrust Enforcement** - The murky federal enforcement landscape has encouraged states to step in.
##### B. State-Specific Antitrust Laws & Reporting Requirements- **Introduction of “Baby HSR” or “Mini HSR” Laws** - Several states have passed laws requiring **notification of healthcare transactions** even if they fall below federal HSR thresholds. - These laws impose **different, sometimes more stringent requirements** than the federal HSR Act. - **Increased Scrutiny of Private Equity in Healthcare** - Many states view **private equity-backed healthcare acquisitions** with skepticism. - Concerns include **profit-driven motives reducing the quality of patient care**. - **Emerging Legislation Targeting the Friendly PC Model** - Some states are **considering or enacting laws to limit the use of professional corporations (PCs)** in structuring healthcare transactions.
#### III. Key Compliance Considerations for Healthcare Transactions##### A. Understanding State-Specific Reporting Obligations- **How requirements vary across states** - **Additional approvals or disclosures that may be required** - **Why some transactions that bypass federal review still require state scrutiny**
##### B. Preparing for Heightened Private Equity Oversight- **What private equity sponsors should expect when investing in healthcare** - **How to mitigate legal risks and structure transactions to comply with state laws**
##### C. Tracking & Adapting to New Laws- **Interactive Tracking Tool for Healthcare Regulations** - Our interactive map tracks **which states have adopted or proposed new reporting regimes**. - Bookmark and monitor updates as laws **continue to evolve.**
#### IV. Conclusion: Adapting to a New Era of State Antitrust Enforcement- **Summary of Key Takeaways** - State regulators are **expanding their role** in antitrust enforcement, particularly in healthcare. - **New state reporting regimes** impose unique requirements beyond the federal HSR Act. - **Private equity transactions face greater scrutiny**, and additional regulatory hurdles may emerge. - **Final Call-to-Action: Stay Ahead of Regulatory Changes** - Healthcare organizations and investors should proactively **track state-level enforcement trends**. - Consult with an experienced healthcare antitrust attorney to **ensure compliance and mitigate risk**.
"""},{"input":"Healthcare Compliance: Key Regulations and Best Practices for Hospitals and Doctors", "output": """### I. Introduction: The Importance of Healthcare Compliance - **Opening Statement:** Healthcare compliance is a critical component of hospital management, ensuring adherence to legal and regulatory standards. - **Why It Matters:** Compliance helps maintain **quality patient care, financial stability, and legal integrity**. - **Challenges in Compliance:** Unlike other industries, healthcare compliance involves **not just business regulations but also medical ethics and patient safety laws**.
---
### II. Why is Healthcare Compliance Important? - **Legal and Ethical Obligations:** - Hospitals must comply with **multiple regulations covering licensing, patient safety, and financial transparency**. - **Risks of Non-Compliance:** - Failure to comply can result in **legal penalties, loss of reputation, and compromised patient care**. - **The Need for Ongoing Compliance Monitoring:** - Regulations are complex and **require continuous oversight and management**.
---
### III. Key Compliance Areas in Healthcare
#### **A. National Medical Commission (NMC) Regulations** - **Role of NMC in Regulating Healthcare Professionals** - **Code of Medical Ethics Regulations (2002)** - Physicians must **display their registration number on all official documents**. - **National Medical Register (NMR):** - Maintains **accurate records of medical practitioners, their qualifications, and workplaces**.
#### **B. Professional Indemnity Insurance** - **Not Legally Mandatory, but Highly Recommended** - **Why It’s Important:** - Protects doctors from **financial risks due to malpractice claims**. - Many hospitals require doctors to maintain **valid indemnity insurance as part of contractual agreements**.
#### **C. Contracts Between Hospitals and Doctors** - **Why Clear Agreements Matter:** - Defines **responsibilities, salary structures, termination clauses**. - **Reduces Legal Disputes:** - Ensures **transparent and smooth relationships between doctors and hospitals**.
#### **D. Licensing and Certification Compliance** - **Doctors Must Maintain Valid Licenses to Practice Legally** - **Compliance Companies Provide Automated Renewal Notifications** - Prevents unintentional **license expiration and potential legal issues**.
#### **E. Post-Contract Salary Regulations** - **What Happens When a Doctor’s Contract Ends?** - Hospitals are **not obligated to pay salaries post-contract, except for pending dues, notice periods, or revenue-sharing agreements**. - **Understanding Revenue-Sharing Models in Healthcare** - Some contracts extend financial obligations **beyond the employment period**.
---
### IV. Consultant and Retainer Compliance in Healthcare
#### **A. Consultant vs. Retainer Arrangements** - **Consultants:** - Independent medical professionals providing specialized services. - Must **maintain tax compliance (GST if applicable) and valid medical licenses**. - **Retainers:** - Hired for **specific periods or projects**, typically without **employee benefits like Provident Fund (PF) or Employee State Insurance (ESI)**. - Contracts must **clearly define responsibilities, tenure, and compensation**.
---
### V. Role of Compliance Management in Healthcare
- **How Compliance Management Services Help Hospitals and Doctors** - **Automated License Renewal Alerts:** Prevents lapses in licensure. - **Contract Management Support:** Ensures clarity in doctor-hospital agreements. - **Indemnity Compliance Assistance:** Helps doctors maintain **financial protection**. - **Regulatory Audits & Updates:** Keeps healthcare institutions **aligned with the latest legal requirements**.
---
### VI. Conclusion: The Need for a Strong Compliance Framework
- **Key Takeaways:** - **Healthcare compliance is essential for patient safety, legal protection, and smooth hospital operations**. - Doctors and hospitals must **actively manage licensing, indemnity, and contracts** to prevent risks. - **The Role of Digital Compliance Solutions:** - Platforms like **Ricago’s Doctor Module** help automate compliance tasks, ensuring **efficiency and legal adherence**. - **Final Call-to-Action:** - Investing in a **structured compliance system enhances patient care, operational efficiency, and legal security**.
"""}]
# Define multiple examples of inputs (topics) and outputs (article outlines)examples = [ { "input": "Healthcare Compliance: Key Regulations and Best Practices for Hospitals and Doctors", "output": "### I. Introduction: The Importance of Healthcare Compliance\n..." }, { "input": "State Antitrust Enforcement in the Healthcare Industry", "output": "### I. Introduction: A Shift Toward State-Led Antitrust Scrutiny\n..." }]
# Define how each example should be formatted in the promptexample_formatter_template = PromptTemplate( input_variables=["input", "output"], template="### Example Input:\n**Topic:** \"{input}\"\n\n### Example Output:\n{output}\n\n")
# Create a Few-Shot Prompt Templatefew_shot_prompt = FewShotPromptTemplate( examples=legal_article_outline, example_prompt=example_formatter_template, prefix="You are an AI assistant that generates structured article outlines based on given topics.", suffix="Now, generate an outline for the following topic:\n\n**Topic:** \"{new_input}\"\n\n### Output:", input_variables=["new_input"])
# Test the prompt with a new inputnew_topic = "Legal Challenges in Telemedicine and Remote Healthcare"
# Format the prompt dynamicallyformatted_prompt = few_shot_prompt.format(new_input=new_topic)
# Print the structured promptprint(formatted_prompt)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803#Article_writer#%% [code]import warningswarnings.filterwarnings("ignore", message=".*TqdmWarning.*")from dotenv import load_dotenv_ = load_dotenv()
from langgraph.graph import StateGraph, ENDfrom typing import TypedDict, Annotated, Listimport operatorfrom langgraph.checkpoint.sqlite import SqliteSaverfrom langchain_core.messages import SystemMessage, HumanMessagefrom langchain_openai import ChatOpenAIfrom pydantic import BaseModelfrom tavily import TavilyClientimport osimport sqlite3from langchain.prompts import FewShotPromptTemplate, PromptTemplatefrom Ewriter_Examples import legal_article_outlineimport time
# -------------------------# Define types and models# -------------------------class AgentState(TypedDict): task: str lnode: str plan: str draft: str critique: str content: List[str] contentd: dict[str, dict[str, str]] queries: List[str] revision_number: int max_revisions: int count: Annotated[int, operator.add]
class Queries(BaseModel): queries: List[str]
# -------------------------# Define the essay writer agent# -------------------------class ewriter(): def __init__(self): # initialize language model and prompts example_formatter_template = PromptTemplate( input_variables=["input", "output"], template="### Example Input:\n**Topic:** \"{input}\"\n\n### Example Output:\n{output}\n\n" ) self.model = ChatOpenAI(model="gpt-4o", temperature=0)
self.PLAN_PROMPT = (
""" Role & Identity: You are a highly experienced marketing expert with over 15 years of success in both traditional and digital marketing. Your expertise spans market research, brand strategy, content marketing, social media, SEO/SEM, email campaigns, analytics, and consumer psychology. You have advised startups, SMEs, and multinational corporations while staying on the cutting edge of industry trends and innovations.
Objective: Create a comprehensive, high-level outline for a promotional article targeted at healthcare professionals. The outline should serve as a strategic blueprint for the article, clearly defining its structure, key messages, and persuasive elements.
Instructions: 1. Overall Structure: - Begin with a compelling introduction that captures the attention of healthcare professionals by addressing their key challenges or interests. - Define clear, main sections (headers) that will guide the article’s flow. Common sections might include: • Introduction • Overview of Healthcare Industry Trends/Challenges • Innovative Solutions or Services Offered • Case Studies or Success Stories • Conclusion with a Strong Call-to-Action - End with a conclusion that reinforces the core message and encourages readers to take action.
2. For Each Section: - Provide a header title. - Include brief, actionable notes or instructions detailing what content should be covered. This may include suggestions on tone, key data points, examples, or calls-to-action. - Ensure that the notes are clear enough to guide subsequent writing phases.
3. Content Integration: - Leverage the information provided below to align the outline with the specific topic and target audience. - Incorporate any relevant healthcare trends, regulatory updates, or market dynamics that would resonate with professionals in the field.
4. Tone & Style: - Use clear, concise, and professional language. - Ensure the outline is logical, persuasive, and easy for the subsequent writer to follow.
Final Note: Produce an actionable and well-organized outline that not only structures the article effectively but also highlights key insights and persuasive elements to engage healthcare professionals.
Use the following examples
Utilize the information below as a resource: ------ {content} """ )
self.PLAN1_PROMPT = FewShotPromptTemplate( examples=legal_article_outline, example_prompt=example_formatter_template, prefix=self.PLAN_PROMPT, suffix="Generate an outline for the user defined topic using the following research content:\n\n**Content:** \"{content}\"\n\n", input_variables=["content"] )
self.MARKETING_PROMPT = ( """
Role & Identity: You are a highly experienced marketing expert with deep knowledge in both traditional and digital marketing. You have over 15 years of experience in market research, brand strategy, content marketing, social media, SEO/SEM, email campaigns, analytics, and consumer psychology. Your work spans startups to multinational corporations, and you are always up to date on the latest industry trends and tools.
Objective: Your goal is to provide actionable, data-driven, and creative marketing strategies that help clients grow their brand, engage their target audience, and achieve measurable business results.
Instructions: 1. Understand the Client’s Context: - Analyze the industry, target audience, and competitive landscape before giving recommendations. - Ask clarifying questions if the client's request is vague or lacks context.
2. Strategy & Recommendations: - Provide both short-term tactics and long-term strategic planning. - Support recommendations with data, examples, or relevant case studies. - Tailor your advice to the client’s specific market, product, or service. - When applicable, list pros and cons for alternative strategies.
Final Note: Always focus on delivering practical, innovative marketing insights. Your expertise should empower clients to make informed decisions and take effective actions in their marketing efforts. """
)
self.WRITER_PROMPT = ( """ [HEALTHCARE LAW ARTICLE WRITER AGENT PROMPT TEMPLATE]
Role & Identity: You are a marketing professional with extensive experience in crafting persuasive, promotional articles that deliver actionable information. You work for Frier Levitt, a law firm specializing in healthcare law based in Montville, New Jersey.
Objective: Your task is to write a compelling article that will be published on our website and shared on social media platforms (e.g., LinkedIn) to attract new clients. The article should ultimately encourage readers to contact Christina Segreto, an attorney at our firm.
Instructions: 1. Structure and Format: - Write the article in multiple paragraphs, ensuring that each paragraph contains at least 5 sentences. - Start each paragraph with an opening sentence that introduces the main idea. - Develop the idea thoroughly in the body of the paragraph. - End each paragraph with a concluding sentence that summarizes the key point. 2. Content and Tone: - The article should be both informative and persuasive, clearly communicating the firm’s expertise in healthcare law. - Maintain a professional, authoritative tone while remaining engaging and accessible. 3. Revision Process: - If the user provides critique or feedback, use it to revise and improve your previous draft accordingly. 4. Citation and References: - Cite all your sources directly within the article. - Include a comprehensive references section at the end of the article. 5. Utilize Provided Information: - Use all the information provided below to inform your writing. - The additional content will be indicated by the following delimiter: ------ {content}
Example: If the outline includes topics such as healthcare compliance challenges, recent legal updates, and landmark litigation case studies, ensure your article discusses these points in detail and ends with a strong call-to-action for readers to contact Christina Segreto.
Final Note: Generate the best possible article based on the user's request, the initial outline, and any subsequent critiques. Your article should effectively position the firm as a trusted authority in healthcare law and motivate potential clients to reach out. """ )
self.RESEARCH_PLAN_PROMPT = ( """ [HEALTHCARE LAW ARTICLE RESEARCH AGENT PROMPT TEMPLATE]
Role & Identity: You are a seasoned research agent with deep expertise in healthcare law, legal research methodologies, and persuasive writing. Your background includes extensive experience in legal analysis, academic research, and industry-specific policy studies. You understand healthcare regulations, case law, and the evolving legal landscape affecting healthcare organizations.
Objective: Your goal is to assist a lawyer in writing an article designed to provide crucial information to key decision makers in the healthcare field. This article should not only inform but also persuade these decision makers to consider the lawyer as a potential client by showcasing deep legal expertise and actionable insights. Generate a list of search queries that will gather any relevant information. Only generate 2 queries max.
Instructions: 1. Review the user-provided outline carefully to understand the structure and key themes of the article. 2. Identify any areas where further research or additional data is needed to support the article’s arguments. 3. Conduct thorough research using reputable sources such as legal journals, government publications, industry reports, and case law databases. 4. Gather up-to-date statistics, relevant legal precedents, regulatory updates, and expert opinions that align with the topics outlined. 5. Organize your findings in a clear and structured format that follows the user’s outline. For each section, provide: - A brief summary of the key points. - Supporting data and legal analysis. - Citations or references to authoritative sources. 6. Use a professional, authoritative tone that is accessible to both legal professionals and non-lawyers, ensuring the information is persuasive and credible. 7. If any part of the outline is ambiguous or requires further clarification, ask follow-up questions to ensure your research meets the intended purpose.
Example Scenario: User Input: "The outline includes sections on healthcare compliance challenges, recent legal changes in healthcare policy, and analyses of landmark hospital litigation cases. Please provide research for each section." Expected Output: "For the section on healthcare compliance challenges, include current CMS guidelines, recent survey data on compliance failures, and key legal cases illustrating the impact of non-compliance. For legal changes, summarize recent amendments to healthcare laws (e.g., updates to the Affordable Care Act) along with expert commentary from legal journals. For hospital litigation, provide analyses of landmark cases, highlighting legal arguments, outcomes, and their implications. Each section should contain specific citations to support the research."
Final Note: Focus on delivering well-organized, credible, and persuasive research that reinforces the lawyer's expertise in healthcare law. Your output should empower the writer to craft an article that informs key decision makers and motivates them to reach out for legal consultation. """ ) self.REFLECTION_PROMPT = ( """ [HEALTHCARE LAW ARTICLE CRITIQUE AGENT PROMPT TEMPLATE]
Role & Identity: You are an expert editor specializing in legal and healthcare content with extensive experience in providing constructive feedback. Your expertise lies in analyzing complex legal writing and offering detailed, actionable critique to help refine and improve the content. You do not rewrite the article; instead, you provide targeted notes and suggestions for improvement.
Objective: Your goal is to review an article draft written by a lawyer specializing in healthcare law. The article is intended to inform key decision makers in the healthcare field and persuade them to consider the lawyer as a potential legal advisor. Your task is to provide clear, structured critique and actionable notes that the writer agent can use to enhance the draft.
Instructions: 1. Read and Analyze: - Carefully review the entire article draft, focusing on its structure, clarity, legal accuracy, and persuasive tone. - Determine if the draft effectively covers the key topics outlined (e.g., healthcare compliance challenges, recent legal updates, landmark litigation cases).
2. Provide Detailed Critique: - Identify specific areas where the article can be improved, such as sections that lack clarity, logical flow, or persuasive impact. - Note any legal details, statistics, or citations that require verification or further explanation. - Highlight any inconsistencies or outdated information that should be updated.
3. Actionable Notes & Suggestions: - List clear, actionable recommendations for improvement. For example, suggest reordering sections, clarifying legal terminology, or incorporating additional evidence. - Pose targeted questions that the writer can address to further strengthen the content (e.g., "Can you include more recent case studies to support this point?" or "Would a clearer explanation of this regulation benefit the reader?"). - Provide feedback on transitions between sections and the overall flow of the article.
4. Tone & Style Recommendations: - Ensure that your feedback maintains a professional and constructive tone. - Offer suggestions for maintaining an authoritative yet accessible voice that will resonate with both legal professionals and non-lawyers. - Emphasize the need for a persuasive call-to-action that motivates healthcare decision makers to reach out.
Example Scenario: User Input: "Please review the draft of my healthcare law article covering compliance issues, legal updates, and major litigation cases, and provide detailed critique and actionable notes." Expected Output: "A structured critique that includes specific feedback such as: 'The introduction could more clearly outline the importance of healthcare compliance to capture the reader’s attention. Consider reorganizing the sections to improve logical flow. Some legal citations in the second section appear outdated and should be verified. Additionally, the call-to-action in the conclusion could be stronger by emphasizing recent case studies that highlight the lawyer’s expertise. Would you consider adding a brief section summarizing these cases?'"
Final Note: Your feedback should be clear, detailed, and actionable, empowering the writer to make effective revisions. Your critique must focus on enhancing the overall quality, persuasiveness, and clarity of the article while maintaining its authoritative tone. """
) self.EDITOR_PROMPT = ( """ [HEALTHCARE LAW ARTICLE EDITOR PROMPT TEMPLATE]
Role & Identity: You are an expert editor specializing in healthcare law content with extensive experience in refining articles for clarity, persuasiveness, and accuracy. You excel at synthesizing detailed critiques and integrating new research information to produce a polished final draft.
Objective: Your task is to produce a revised version of the article draft by incorporating the editor’s critique and the additional research content provided. The final article should address all feedback points, update outdated information, and include relevant, authoritative data and legal citations that strengthen the article’s message.
Instructions: 1. Review Inputs: - Carefully review the original article draft. - Analyze the detailed critique that highlights areas needing improvement (structure, clarity, legal accuracy, persuasiveness, etc.). - Examine the new research information that provides updated data, legal citations, case studies, and expert opinions.
2. Editing Process: - Integrate the critique by addressing specific feedback (e.g., reorganize paragraphs, clarify legal terminology, strengthen call-to-action, etc.). - Seamlessly incorporate the new research details into the article. Update or add data, legal precedents, and citations where necessary. - Ensure that each paragraph maintains a minimum of 5 sentences, starts with an opening sentence introducing the main idea, elaborates with detailed information, and concludes with a summarizing sentence. - Enhance the overall flow and transitions between paragraphs to create a cohesive narrative.
3. Citation and References: - Cite all new sources and legal references directly within the text. - Update the references section at the end of the article to include all newly incorporated sources.
4. Final Output: - Produce a final, revised version of the article that is clear, persuasive, and authoritative. - Ensure the article effectively positions the law firm as a leader in healthcare law and motivates key decision makers to reach out to Christina Segreto.
Example Scenario: User Input: "Here is the critique along with new research information for the article. Please revise the draft accordingly." Expected Output: "A revised article that reflects all suggested improvements from the critique and incorporates updated legal citations and research data. The article should have improved structure, stronger persuasive elements, and a complete references section listing all sources."
Final Note: Your final revision should be a comprehensive synthesis of the original content, the editor’s critique, and the new research information, resulting in a polished article that meets the firm’s high standards of clarity and authority. """
) self.RESEARCH_CRITIQUE_PROMPT = ( """ [HEALTHCARE LAW ARTICLE REVISION RESEARCH AGENT PROMPT TEMPLATE]
Role & Identity: You are a research expert with extensive experience in legal and healthcare research. Your focus is on providing actionable, targeted search queries that gather additional, relevant information to support revisions requested in an editor's critique of a healthcare law article.
Objective: Your task is to generate a list of up to 8 precise search queries that will help retrieve information addressing the specific issues highlighted in the critique. These queries should be designed to gather up-to-date, reputable data, case studies, legal precedents, and expert opinions, empowering the writer to make the requested revisions effectively.
Instructions: 1. Review the Provided Critique: - Identify the key areas where additional information is needed (e.g., updated legal citations, recent case studies, data on healthcare compliance, etc.). 2. Generate Search Queries: - Create clear and specific search queries tailored to address the revisions requested. - Ensure each query targets high-quality, authoritative sources in the field of healthcare law. - Limit your output to a maximum of 8 queries. 3. Query Focus: - Retrieve the most recent legal updates or case studies relevant to healthcare law. - Provide detailed data and expert commentary on issues such as compliance challenges and landmark litigation. - Address both broad topics and specific elements as highlighted in the critique. 4. Tone & Clarity: - Use a professional and focused tone. - Ensure each query is concise and directly related to the requested revisions.
Example Scenario: Critique Notes: "Some legal citations in the second section appear outdated and should be verified. Additionally, the call-to-action in the conclusion could be strengthened by referencing recent landmark healthcare litigation cases." Expected Output: 1. "Recent healthcare law legal updates 2024" 2. "Updated legal citations for healthcare compliance" 3. "Landmark healthcare litigation cases analysis" 4. "Impact of recent healthcare lawsuits on compliance" 5. "Expert commentary on healthcare law revisions" 6. "Case studies on hospital litigation outcomes" (Include additional queries if necessary, up to 8 total)
Final Note: Focus on delivering concise, targeted queries that will enable the writer to access the most relevant and authoritative information for making the necessary revisions. """
) self.tavily = TavilyClient(api_key=os.environ["TAVILY_API_KEY"])
# Build the state graph by adding nodes and edges builder = StateGraph(AgentState) builder.add_node("prep_research", self.prep_node) builder.add_node("planner", self.plan_node) builder.add_node("research_plan", self.research_plan_node) builder.add_node("generate", self.generation_node) builder.add_node("reflect", self.reflection_node) builder.add_node("research_critique", self.research_critique_node) builder.add_node("editor", self.editor_node)
builder.set_entry_point("prep_research") builder.add_conditional_edges( "editor", self.should_continue, {END: END, "reflect": "reflect"} ) builder.add_edge("prep_research","planner") builder.add_edge("planner", "research_plan") builder.add_edge("research_plan", "generate") builder.add_edge("generate","reflect") builder.add_edge("reflect", "research_critique") builder.add_edge("research_critique", "editor")
memory = SqliteSaver(conn=sqlite3.connect(":memory:", check_same_thread=False)) self.graph = builder.compile( checkpointer=memory, interrupt_after=['planner', 'generate', 'reflect', 'research_plan', 'research_critique'] )
def prep_node(self, state: AgentState): queries = self.model.with_structured_output(Queries).invoke([ SystemMessage(content=self.MARKETING_PROMPT), HumanMessage(content=f"""\n\nGenerate a list of at most 12 quiries that will be used to help understand the topic and to help write an outline for an article used as a marketing tool for Christina Segreto, an attorney at Frier Levitt a boutique healthcare law lawfirm. \n\n Topic:\n\n{state['task']}""" ) ]) #content = state['content'] or [] # add to content content = [] # add to content for q in queries.queries: response = self.tavily.search(query=q, max_results=3) for r in response['results']: content.append(r['content']) return { "content": content, "queries": queries.queries, "lnode": "prep_research", "count": 1, } def plan_node(self, state: AgentState): content = "\n\n".join(state['content'] or []) user_message = HumanMessage( content=f"Now, generate an outline for the following topic:\n\n**Topic:** \"{state['task']}\"\n\n### Output:" ) messages = [ SystemMessage(content=self.PLAN1_PROMPT.format(content=content)), user_message ] response = self.model.invoke(messages) return { "plan": response.content, "lnode": "planner", "count": 1, }
''' def plan_node1(self, state: AgentState): content = "\n\n".join(state['content'] or []) user_message = HumanMessage( content=f"\n\nThe topic of the article is:\n\n{state['task']}" ) messages = [ SystemMessage(content=self.PLAN_PROMPT.format(content=content)), user_message ] response = self.model.invoke(messages) return { "plan": response.content, "lnode": "planner", "count": 1, } '''
def research_plan_node(self, state: AgentState): queries = self.model.with_structured_output(Queries).invoke([ SystemMessage(content=self.RESEARCH_PLAN_PROMPT), HumanMessage(content=f"\n\nThe topic of the article is:\n\n{state['task']}") ]) content = state['content'] or [] # add to content for q in queries.queries: response = self.tavily.search(query=q, max_results=2) for r in response['results']: content.append(r['content']) return { "content": content, "queries": queries.queries, "lnode": "research_plan", "count": 1, }#Make sure the generation node gets the critique#Maybe I should just create a new node the does the revisions. #And leave the generation node as like the first draft node. def generation_node(self, state: AgentState): content = "\n\n".join(state['content'] or []) user_message = HumanMessage( content=f"Here is the topic:\n\n{state['task']}\n\nHere is my outline:\n\n{state['plan']}" ) messages = [ SystemMessage(content=self.WRITER_PROMPT.format(content=content)), user_message ] response = self.model.invoke(messages) return { "draft": response.content, "revision_number": state.get("revision_number", 0) + 1, "lnode": "generate", "count": 1, } def editor_node(self, state: AgentState): #content = "\n\n".join(state['content'] or []) user_message = HumanMessage( content=f"Here is the most recent draft:\n\n{state['draft']}\n\n Here is the critique:\n\n{state['critique']}\n\n Here is all of the research:\n\n{state['content']}" ) messages = [ SystemMessage(content=self.EDITOR_PROMPT), user_message ] response = self.model.invoke(messages) return { "draft": response.content, "revision_number": state.get("revision_number", 0) + 1, "lnode": "editor", "count": 1, }
def reflection_node(self, state: AgentState): messages = [ SystemMessage(content=self.REFLECTION_PROMPT), HumanMessage(content=state['draft']) ] response = self.model.invoke(messages) return { "critique": response.content, "lnode": "reflect", "count": 1, }
def research_critique_node(self, state: AgentState): queries = self.model.with_structured_output(Queries).invoke([ SystemMessage(content=self.RESEARCH_CRITIQUE_PROMPT), HumanMessage(content=state['critique']) ]) content = state['content'] or [] for q in queries.queries: response = self.tavily.search(query=q, max_results=2) for r in response['results']: content.append(r['content']) return { "content": content, "lnode": "research_critique", "count": 1, } def should_continue(self, state): if state["revision_number"] >= state["max_revisions"]: state["lnode"] = END return END # Stops execution without looping return "reflect"
import gradio as grimport time
class writer_gui( ): def __init__(self, graph, share=False): self.graph = graph self.share = share self.partial_message = "" self.response = {} self.max_iterations = 10 self.iterations = [] self.threads = [] self.thread_id = -1 self.thread = {"configurable": {"thread_id": str(self.thread_id)}} #self.sdisps = {} #global self.demo = self.create_interface()
def run_agent(self, start,topic,stop_after): #global partial_message, thread_id,thread #global response, max_iterations, iterations, threads if start: self.iterations.append(0) config = {'task': topic,"max_revisions": 2,"revision_number": 0, 'lnode': "", 'planner': "no plan", 'draft': "no draft", 'critique': "no critique", 'content': ["no content",], 'queries': "no queries", 'count':0} self.thread_id += 1 # new agent, new thread self.threads.append(self.thread_id) else: config = None self.thread = {"configurable": {"thread_id": str(self.thread_id)}} while self.iterations[self.thread_id] < self.max_iterations: self.response = self.graph.invoke(config, self.thread) self.iterations[self.thread_id] += 1 self.partial_message += str(self.response) self.partial_message += f"\n------------------\n\n" ## fix lnode,nnode,_,rev,acount = self.get_disp_state() yield self.partial_message,lnode,nnode,self.thread_id,rev,acount config = None #need #print(f"run_agent:{lnode}") if not nnode: #print("Hit the end") return if lnode in stop_after: #print(f"stopping due to stop_after {lnode}") return else: #print(f"Not stopping on lnode {lnode}") pass return def get_disp_state(self,): current_state = self.graph.get_state(self.thread) lnode = current_state.values["lnode"] acount = current_state.values["count"] rev = current_state.values["revision_number"] nnode = current_state.next #print (lnode,nnode,self.thread_id,rev,acount) return lnode,nnode,self.thread_id,rev,acount def get_state(self,key): current_values = self.graph.get_state(self.thread) if key in current_values.values: lnode,nnode,self.thread_id,rev,astep = self.get_disp_state() new_label = f"last_node: {lnode}, thread_id: {self.thread_id}, rev: {rev}, step: {astep}" return gr.update(label=new_label, value=current_values.values[key]) else: return "" def get_content(self,): current_values = self.graph.get_state(self.thread) if "content" in current_values.values: content = current_values.values["content"] lnode,nnode,thread_id,rev,astep = self.get_disp_state() new_label = f"last_node: {lnode}, thread_id: {self.thread_id}, rev: {rev}, step: {astep}" return gr.update(label=new_label, value="\n\n".join(item for item in content) + "\n\n") else: return "" def update_hist_pd(self,): #print("update_hist_pd") hist = [] # curiously, this generator returns the latest first for state in self.graph.get_state_history(self.thread): if state.metadata['step'] < 1: continue thread_ts = state.config['configurable']['thread_ts'] tid = state.config['configurable']['thread_id'] count = state.values['count'] lnode = state.values['lnode'] rev = state.values['revision_number'] nnode = state.next st = f"{tid}:{count}:{lnode}:{nnode}:{rev}:{thread_ts}" hist.append(st) return gr.Dropdown(label="update_state from: thread:count:last_node:next_node:rev:thread_ts", choices=hist, value=hist[0],interactive=True) def find_config(self,thread_ts): for state in self.graph.get_state_history(self.thread): config = state.config if config['configurable']['thread_ts'] == thread_ts: return config return(None) def copy_state(self,hist_str): ''' result of selecting an old state from the step pulldown. Note does not change thread. This copies an old state to a new current state. ''' thread_ts = hist_str.split(":")[-1] #print(f"copy_state from {thread_ts}") config = self.find_config(thread_ts) #print(config) state = self.graph.get_state(config) self.graph.update_state(self.thread, state.values, as_node=state.values['lnode']) new_state = self.graph.get_state(self.thread) #should now match new_thread_ts = new_state.config['configurable']['thread_ts'] tid = new_state.config['configurable']['thread_id'] count = new_state.values['count'] lnode = new_state.values['lnode'] rev = new_state.values['revision_number'] nnode = new_state.next return lnode,nnode,new_thread_ts,rev,count def update_thread_pd(self,): #print("update_thread_pd") return gr.Dropdown(label="choose thread", choices=threads, value=self.thread_id,interactive=True) def switch_thread(self,new_thread_id): #print(f"switch_thread{new_thread_id}") self.thread = {"configurable": {"thread_id": str(new_thread_id)}} self.thread_id = new_thread_id return def modify_state(self,key,asnode,new_state): ''' gets the current state, modifes a single value in the state identified by key, and updates state with it. note that this will create a new 'current state' node. If you do this multiple times with different keys, it will create one for each update. Note also that it doesn't resume after the update ''' current_values = self.graph.get_state(self.thread) current_values.values[key] = new_state self.graph.update_state(self.thread, current_values.values,as_node=asnode) return
def create_interface(self): with gr.Blocks(theme=gr.themes.Default(spacing_size='sm',text_size="sm")) as demo: def updt_disp(): ''' general update display on state change ''' current_state = self.graph.get_state(self.thread) hist = [] # curiously, this generator returns the latest first for state in self.graph.get_state_history(self.thread): if state.metadata['step'] < 1: #ignore early states continue s_thread_ts = state.config.get('configurable', {}).get('thread_ts', None) #s_thread_ts = state.config['configurable']['thread_ts'] s_tid = state.config['configurable']['thread_id'] s_count = state.values['count'] s_lnode = state.values['lnode'] s_rev = state.values['revision_number'] s_nnode = state.next st = f"{s_tid}:{s_count}:{s_lnode}:{s_nnode}:{s_rev}:{s_thread_ts}" hist.append(st) if not current_state.metadata: #handle init call return{} else: return { topic_bx : current_state.values["task"], lnode_bx : current_state.values["lnode"], count_bx : current_state.values["count"], revision_bx : current_state.values["revision_number"], nnode_bx : current_state.next, threadid_bx : self.thread_id, thread_pd : gr.Dropdown(label="choose thread", choices=self.threads, value=self.thread_id,interactive=True), step_pd : gr.Dropdown(label="update_state from: thread:count:last_node:next_node:rev:thread_ts", choices=hist, value=hist[0],interactive=True), } def get_snapshots(): new_label = f"thread_id: {self.thread_id}, Summary of snapshots" sstate = "" for state in self.graph.get_state_history(self.thread): for key in ['plan', 'draft', 'critique']: if key in state.values: state.values[key] = state.values[key][:80] + "..." if 'content' in state.values: for i in range(len(state.values['content'])): state.values['content'][i] = state.values['content'][i][:20] + '...' if 'writes' in state.metadata: state.metadata['writes'] = "not shown" sstate += str(state) + "\n\n" return gr.update(label=new_label, value=sstate)
def vary_btn(stat): #print(f"vary_btn{stat}") return(gr.update(variant=stat)) with gr.Tab("Agent"): with gr.Row(): topic_bx = gr.Textbox(label="Essay Topic", value="Pizza Shop") gen_btn = gr.Button("Generate Essay", scale=0,min_width=80, variant='primary') cont_btn = gr.Button("Continue Essay", scale=0,min_width=80) with gr.Row(): lnode_bx = gr.Textbox(label="last node", min_width=100) nnode_bx = gr.Textbox(label="next node", min_width=100) threadid_bx = gr.Textbox(label="Thread", scale=0, min_width=80) revision_bx = gr.Textbox(label="Draft Rev", scale=0, min_width=80) count_bx = gr.Textbox(label="count", scale=0, min_width=80) with gr.Accordion("Manage Agent", open=False): checks = list(self.graph.nodes.keys()) checks.remove('__start__') stop_after = gr.CheckboxGroup(checks,label="Interrupt After State", value=checks, scale=0, min_width=400) with gr.Row(): thread_pd = gr.Dropdown(choices=self.threads,interactive=True, label="select thread", min_width=120, scale=0) step_pd = gr.Dropdown(choices=['N/A'],interactive=True, label="select step", min_width=160, scale=1) live = gr.Textbox(label="Live Agent Output", lines=5, max_lines=5) # actions sdisps =[topic_bx,lnode_bx,nnode_bx,threadid_bx,revision_bx,count_bx,step_pd,thread_pd] thread_pd.input(self.switch_thread, [thread_pd], None).then( fn=updt_disp, inputs=None, outputs=sdisps) step_pd.input(self.copy_state,[step_pd],None).then( fn=updt_disp, inputs=None, outputs=sdisps) gen_btn.click(vary_btn,gr.Number("secondary", visible=False), gen_btn).then( fn=self.run_agent, inputs=[gr.Number(True, visible=False),topic_bx,stop_after], outputs=[live],show_progress=True).then( fn=updt_disp, inputs=None, outputs=sdisps).then( vary_btn,gr.Number("primary", visible=False), gen_btn).then( vary_btn,gr.Number("primary", visible=False), cont_btn) cont_btn.click(vary_btn,gr.Number("secondary", visible=False), cont_btn).then( fn=self.run_agent, inputs=[gr.Number(False, visible=False),topic_bx,stop_after], outputs=[live]).then( fn=updt_disp, inputs=None, outputs=sdisps).then( vary_btn,gr.Number("primary", visible=False), cont_btn) with gr.Tab("Plan"): with gr.Row(): refresh_btn = gr.Button("Refresh") modify_btn = gr.Button("Modify") plan = gr.Textbox(label="Plan", lines=10, interactive=True) refresh_btn.click(fn=self.get_state, inputs=gr.Number("plan", visible=False), outputs=plan) modify_btn.click(fn=self.modify_state, inputs=[gr.Number("plan", visible=False), gr.Number("planner", visible=False), plan],outputs=None).then( fn=updt_disp, inputs=None, outputs=sdisps) with gr.Tab("Research Content"): refresh_btn = gr.Button("Refresh") content_bx = gr.Textbox(label="content", lines=10) refresh_btn.click(fn=self.get_content, inputs=None, outputs=content_bx) with gr.Tab("Draft"): with gr.Row(): refresh_btn = gr.Button("Refresh") modify_btn = gr.Button("Modify") draft_bx = gr.Textbox(label="draft", lines=10, interactive=True) refresh_btn.click(fn=self.get_state, inputs=gr.Number("draft", visible=False), outputs=draft_bx) modify_btn.click(fn=self.modify_state, inputs=[gr.Number("draft", visible=False), gr.Number("generate", visible=False), draft_bx], outputs=None).then( fn=updt_disp, inputs=None, outputs=sdisps) with gr.Tab("Critique"): with gr.Row(): refresh_btn = gr.Button("Refresh") modify_btn = gr.Button("Modify") critique_bx = gr.Textbox(label="Critique", lines=10, interactive=True) refresh_btn.click(fn=self.get_state, inputs=gr.Number("critique", visible=False), outputs=critique_bx) modify_btn.click(fn=self.modify_state, inputs=[gr.Number("critique", visible=False), gr.Number("reflect", visible=False), critique_bx], outputs=None).then( fn=updt_disp, inputs=None, outputs=sdisps) with gr.Tab("StateSnapShots"): with gr.Row(): refresh_btn = gr.Button("Refresh") snapshots = gr.Textbox(label="State Snapshots Summaries") refresh_btn.click(fn=get_snapshots, inputs=None, outputs=snapshots) return demo
def launch(self, share=None): self.demo.launch(share=False)
MultiAgent = ewriter()app = writer_gui(MultiAgent.graph)app.launch()
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238# packages in environment at /Users/JSegreto/anaconda3/envs/langchain_env:## Name Version Build Channeladwaita-icon-theme 47.0 unix_0 conda-forgeaiofiles 23.2.1 pypi_0 pypiaiohappyeyeballs 2.4.4 pypi_0 pypiaiohttp 3.11.11 pypi_0 pypiaiosignal 1.3.2 pypi_0 pypiaiosqlite 0.20.0 pypi_0 pypiannotated-types 0.7.0 pypi_0 pypianyio 4.8.0 pypi_0 pypiappnope 0.1.4 pyhd8ed1ab_1 conda-forgeargon2-cffi 23.1.0 pypi_0 pypiargon2-cffi-bindings 21.2.0 pypi_0 pypiarrow 1.3.0 pypi_0 pypiasttokens 3.0.0 pyhd8ed1ab_1 conda-forgeasync-lru 2.0.4 pypi_0 pypiasync-timeout 4.0.3 pypi_0 pypiatk-1.0 2.38.0 h4bec284_2 conda-forgeattrs 25.1.0 pypi_0 pypibabel 2.17.0 pypi_0 pypibeautifulsoup4 4.13.3 pypi_0 pypibleach 6.2.0 pypi_0 pypibzip2 1.0.8 hfdf4475_7 conda-forgeca-certificates 2025.1.31 h8857fd0_0 conda-forgecairo 1.18.2 h950ec3b_1 conda-forgecertifi 2025.1.31 pypi_0 pypicffi 1.17.1 pypi_0 pypicharset-normalizer 3.4.1 pypi_0 pypiclick 8.1.8 pypi_0 pypicomm 0.2.2 pyhd8ed1ab_1 conda-forgedataclasses-json 0.6.7 pypi_0 pypidebugpy 1.8.12 py310h6954a95_0 conda-forgedecorator 5.1.1 pyhd8ed1ab_1 conda-forgedefusedxml 0.7.1 pypi_0 pypidistro 1.9.0 pypi_0 pypiepoxy 1.5.10 h5eb16cf_1 conda-forgeexceptiongroup 1.2.2 pyhd8ed1ab_1 conda-forgeexecuting 2.1.0 pyhd8ed1ab_1 conda-forgefastapi 0.115.8 pypi_0 pypifastjsonschema 2.21.1 pypi_0 pypiffmpy 0.5.0 pypi_0 pypifilelock 3.17.0 pypi_0 pypifont-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forgefont-ttf-inconsolata 3.000 h77eed37_0 conda-forgefont-ttf-source-code-pro 2.038 h77eed37_0 conda-forgefont-ttf-ubuntu 0.83 h77eed37_3 conda-forgefontconfig 2.15.0 h37eeddb_1 conda-forgefonts-conda-ecosystem 1 0 conda-forgefonts-conda-forge 1 0 conda-forgefqdn 1.5.1 pypi_0 pypifreetype 2.12.1 h60636b9_2 conda-forgefribidi 1.0.10 hbcb3906_0 conda-forgefrozenlist 1.5.0 pypi_0 pypifsspec 2025.2.0 pypi_0 pypigdk-pixbuf 2.42.12 ha587570_0 conda-forgeglib-tools 2.82.2 hf8faeaf_1 conda-forgegradio 5.14.0 pypi_0 pypigradio-client 1.7.0 pypi_0 pypigraphite2 1.3.13 h73e2aa4_1003 conda-forgegraphviz 0.20.3 pypi_0 pypigreenlet 3.1.1 pypi_0 pypigtk3 3.24.43 h82a860e_3 conda-forgegts 0.7.6 h53e17e3_4 conda-forgeh11 0.14.0 pypi_0 pypiharfbuzz 10.2.0 h5b25545_0 conda-forgehicolor-icon-theme 0.17 h694c41f_2 conda-forgehttpcore 1.0.7 pypi_0 pypihttpx 0.28.1 pypi_0 pypihttpx-sse 0.4.0 pypi_0 pypihuggingface-hub 0.28.1 pypi_0 pypiicu 75.1 h120a0e1_0 conda-forgeidna 3.10 pypi_0 pypiimportlib-metadata 8.6.1 pyha770c72_0 conda-forgeipykernel 6.29.5 pyh57ce528_0 conda-forgeipython 8.31.0 pyh707e725_0 conda-forgeipywidgets 8.1.5 pypi_0 pypiisoduration 20.11.0 pypi_0 pypijedi 0.19.2 pyhd8ed1ab_1 conda-forgejinja2 3.1.5 pypi_0 pypijiter 0.8.2 pypi_0 pypijson5 0.10.0 pypi_0 pypijsonpatch 1.33 pypi_0 pypijsonpointer 3.0.0 pypi_0 pypijsonschema 4.23.0 pypi_0 pypijsonschema-specifications 2024.10.1 pypi_0 pypijupyter 1.1.1 pypi_0 pypijupyter-console 6.6.3 pypi_0 pypijupyter-events 0.12.0 pypi_0 pypijupyter-lsp 2.2.5 pypi_0 pypijupyter-server 2.15.0 pypi_0 pypijupyter-server-terminals 0.5.3 pypi_0 pypijupyter_client 8.6.3 pyhd8ed1ab_1 conda-forgejupyter_core 5.7.2 pyh31011fe_1 conda-forgejupyterlab 4.3.5 pypi_0 pypijupyterlab-pygments 0.3.0 pypi_0 pypijupyterlab-server 2.27.3 pypi_0 pypijupyterlab-widgets 3.0.13 pypi_0 pypikrb5 1.21.3 h37d8d59_0 conda-forgelangchain 0.3.17 pypi_0 pypilangchain-community 0.3.16 pypi_0 pypilangchain-core 0.3.33 pypi_0 pypilangchain-openai 0.3.3 pypi_0 pypilangchain-text-splitters 0.3.5 pypi_0 pypilanggraph 0.2.69 pypi_0 pypilanggraph-checkpoint 2.0.10 pypi_0 pypilanggraph-checkpoint-sqlite 2.0.3 pypi_0 pypilanggraph-sdk 0.1.51 pypi_0 pypilangsmith 0.3.3 pypi_0 pypilerc 4.0.0 hb486fe8_0 conda-forgelibasprintf 0.23.1 h27064b9_0 conda-forgelibcxx 19.1.7 hf95d169_0 conda-forgelibdeflate 1.23 he65b83e_0 conda-forgelibedit 3.1.20240808 pl5321ha958ccf_0 conda-forgelibexpat 2.6.4 h240833e_0 conda-forgelibffi 3.4.2 h0d85af4_5 conda-forgelibgd 2.3.3 h8555400_11 conda-forgelibgettextpo 0.23.1 h27064b9_0 conda-forgelibglib 2.82.2 h5c976ab_1 conda-forgelibiconv 1.17 hd75f5a5_2 conda-forgelibintl 0.23.1 h27064b9_0 conda-forgelibjpeg-turbo 3.0.0 h0dc2134_1 conda-forgeliblzma 5.6.3 hd471939_1 conda-forgelibpng 1.6.46 h3c4a55f_0 conda-forgelibrsvg 2.58.4 h21a6cfa_2 conda-forgelibsodium 1.0.20 hfdf4475_0 conda-forgelibsqlite 3.48.0 hdb6dae5_1 conda-forgelibtiff 4.7.0 hb77a491_3 conda-forgelibwebp-base 1.5.0 h6cf52b4_0 conda-forgelibxml2 2.13.5 hebb159f_1 conda-forgelibzlib 1.3.1 hd23fc13_2 conda-forgemarkdown-it-py 3.0.0 pypi_0 pypimarkupsafe 2.1.5 pypi_0 pypimarshmallow 3.26.0 pypi_0 pypimatplotlib-inline 0.1.7 pyhd8ed1ab_1 conda-forgemdurl 0.1.2 pypi_0 pypimistune 3.1.2 pypi_0 pypimsgpack 1.1.0 pypi_0 pypimultidict 6.1.0 pypi_0 pypimypy-extensions 1.0.0 pypi_0 pypinbclient 0.10.2 pypi_0 pypinbconvert 7.16.6 pypi_0 pypinbformat 5.10.4 pypi_0 pypincurses 6.5 h0622a9a_3 conda-forgenest-asyncio 1.6.0 pyhd8ed1ab_1 conda-forgenotebook 7.3.2 pypi_0 pypinotebook-shim 0.2.4 pypi_0 pypinumpy 1.26.4 pypi_0 pypiopenai 1.60.2 pypi_0 pypiopenssl 3.4.0 hc426f3f_1 conda-forgeorjson 3.10.15 pypi_0 pypioverrides 7.7.0 pypi_0 pypipackaging 24.2 pyhd8ed1ab_2 conda-forgepandas 2.2.3 pypi_0 pypipandocfilters 1.5.1 pypi_0 pypipango 1.56.1 hf94f63b_0 conda-forgeparso 0.8.4 pyhd8ed1ab_1 conda-forgepcre2 10.44 h7634a1b_2 conda-forgepexpect 4.9.0 pyhd8ed1ab_1 conda-forgepickleshare 0.7.5 pyhd8ed1ab_1004 conda-forgepillow 11.1.0 pypi_0 pypipip 25.0 pyh8b19718_0 conda-forgepixman 0.44.2 h1fd1274_0 conda-forgeplatformdirs 4.3.6 pyhd8ed1ab_1 conda-forgeprometheus-client 0.21.1 pypi_0 pypiprompt-toolkit 3.0.50 pyha770c72_0 conda-forgepropcache 0.2.1 pypi_0 pypipsutil 6.1.1 py310hbb8c376_0 conda-forgeptyprocess 0.7.0 pyhd8ed1ab_1 conda-forgepure_eval 0.2.3 pyhd8ed1ab_1 conda-forgepycparser 2.22 pypi_0 pypipydantic 2.10.6 pypi_0 pypipydantic-core 2.27.2 pypi_0 pypipydantic-settings 2.7.1 pypi_0 pypipydub 0.25.1 pypi_0 pypipygments 2.19.1 pyhd8ed1ab_0 conda-forgepygraphviz 1.14 py310h9314e7d_0 conda-forgepython 3.10.16 h5acdff8_1_cpython conda-forgepython-dateutil 2.9.0.post0 pyhff2d567_1 conda-forgepython-dotenv 1.0.1 pypi_0 pypipython-json-logger 3.2.1 pypi_0 pypipython-multipart 0.0.20 pypi_0 pypipython_abi 3.10 5_cp310 conda-forgepytz 2025.1 pypi_0 pypipyyaml 6.0.2 pypi_0 pypipyzmq 26.2.0 py310h0c870a2_3 conda-forgereadline 8.2 h9e318b2_1 conda-forgereferencing 0.36.2 pypi_0 pypiregex 2024.11.6 pypi_0 pypirequests 2.32.3 pypi_0 pypirequests-toolbelt 1.0.0 pypi_0 pypirfc3339-validator 0.1.4 pypi_0 pypirfc3986-validator 0.1.1 pypi_0 pypirich 13.9.4 pypi_0 pypirpds-py 0.22.3 pypi_0 pypiruff 0.9.4 pypi_0 pypisafehttpx 0.1.6 pypi_0 pypisemantic-version 2.10.0 pypi_0 pypisend2trash 1.8.3 pypi_0 pypisetuptools 75.8.0 pyhff2d567_0 conda-forgeshellingham 1.5.4 pypi_0 pypisix 1.17.0 pyhd8ed1ab_0 conda-forgesniffio 1.3.1 pypi_0 pypisoupsieve 2.6 pypi_0 pypisqlalchemy 2.0.37 pypi_0 pypistack_data 0.6.3 pyhd8ed1ab_1 conda-forgestarlette 0.45.3 pypi_0 pypitavily-python 0.5.0 pypi_0 pypitenacity 9.0.0 pypi_0 pypiterminado 0.18.1 pypi_0 pypitiktoken 0.8.0 pypi_0 pypitinycss2 1.4.0 pypi_0 pypitk 8.6.13 h1abcd95_1 conda-forgetomli 2.2.1 pypi_0 pypitomlkit 0.13.2 pypi_0 pypitornado 6.4.2 py310hbb8c376_0 conda-forgetqdm 4.67.1 pypi_0 pypitraitlets 5.14.3 pyhd8ed1ab_1 conda-forgetyper 0.15.1 pypi_0 pypitypes-python-dateutil 2.9.0.20241206 pypi_0 pypityping-inspect 0.9.0 pypi_0 pypityping_extensions 4.12.2 pyha770c72_1 conda-forgetzdata 2025.1 pypi_0 pypiuri-template 1.3.0 pypi_0 pypiurllib3 2.3.0 pypi_0 pypiuvicorn 0.34.0 pypi_0 pypiwcwidth 0.2.13 pyhd8ed1ab_1 conda-forgewebcolors 24.11.1 pypi_0 pypiwebencodings 0.5.1 pypi_0 pypiwebsocket-client 1.8.0 pypi_0 pypiwebsockets 14.2 pypi_0 pypiwheel 0.45.1 pyhd8ed1ab_1 conda-forgewidgetsnbextension 4.0.13 pypi_0 pypiyarl 1.18.3 pypi_0 pypizeromq 4.3.5 h7130eaa_7 conda-forgezipp 3.21.0 pyhd8ed1ab_1 conda-forgezstandard 0.23.0 pypi_0 pypizstd 1.5.6 h915ae27_0 conda-forgeEwriter_Examples.pyAdded+273
app.pyAdded+803
requirements.txtAdded+238