79346810

Date: 2025-01-10 19:28:49
Score: 0.5
Natty:
Report link

it's an interpolation error. when calling kickoff(), you are giving 'topic' as the only variable name to interpolate but have no reference to it (i.e. {topic}), but in week_0_ramp_up_task you are interpolating url (item a. you have {url}) but aren't passing it as an input in kickoff().

editing the code as follows resolved any errors for me:

from typing import List

from crewai import Agent, Task, LLM, Crew
from crewai.tools import tool

inputs={
        'topic': 'Internal experts in mining technology',
        'url': 'https://privatecapital.mckinsey.digital/survey-templates'
}

llm = LLM(
    model="gpt-4o",
    base_url="https://openai.prod.ai-gateway.quantumblack.com/0b0e19f0-3019-4d9e-bc36-1bd53ed23dc2/v1",
    api_key="YOUR_API_KEY_HERE"
)

ddagent = Agent(role="Assistant helping in executing due diligence steps",
                goal="""To help an user performing due diligence to achieve a specified task or multiple tasks. "
                      Sometimes multiple tasks need to be performed. The tasks need not be in a sequence""",
                backstory='You are aware about all the detail tasks of due diligence. You have access to the necessary content and best practices',
                verbose=True,
                memory=True,
                llm=llm
                )


@tool("get_experts")
def get_experts(topic: str) -> List[str]:
    """Tool returns a list of expert names."""
    # Tool logic here
    expert_list = []
    expert_list.append("Souradipta Roy")
    expert_list.append("Dushyant Agarwal")
    return expert_list


@tool("get_documents")
def get_documents(topic: str) -> List[str]:
    """Tool returns a list of document names."""

    # Tool logic here
    documents_list = []
    documents_list.append("document 1")
    documents_list.append("document 2")
    return documents_list


research_task = Task(
    description="""
        Respond withe appropriate output mentioned in the expected outputs when the user wants
        to create a survey or wants to know anything about survey creation or survey analysis.
    """,
    expected_output="""
        Respond with the following:
        Great, to create surveys and drive analytics, there are currently two resources to utilize:
    a.    Survey Templates - Discover our collection of survey templates. The link for that tool is **https://privatecapital.mckinsey.digital/survey-templates**
    b.    Survey Navigator - Streamline survey creation, analysis, and reporting for client services team. The link for that tool is ** https://surveynavigator.intellisurvey.com/rel-9/admin/#/surveys**
    """,
    agent=ddagent,
    verbose=True
)

internal_experts_task = Task(
    description=f"""
        Respond with an appropriate sentence output listing the firm experts based on the {inputs["topic"]} mentioned.
    """,
    expected_output=f"""
        Respond with an appropriate sentence output listing the firm experts based on the {inputs["topic"]} mentioned.
        The firm experts are retrieved from the tool get_experts.""",
    agent=ddagent,
    tools=[get_experts],
    verbose=True
)

week_0_ramp_up_task = Task(
    description="""
        You are responsible for helping the user with Week 0 ramp up. There will be 6 sub-steps in this. If user chooses any of below sub-steps except document recommendations then provide details on respective option chosen.
    """,
    expected_output=f"""
        If user chooses any of below sub-steps except document recommendations then provide details on respective option chosen.

    a.    Get transcript for pre-reads or generate an AI Report - “For transcript recommendations, please go to the Interview Insights (Transcript Library) solution to read up on transcripts relevant to the DD topic.” Here is the link for Interview Insights {inputs["url"]}. The Interview Insights platform includes AI-driven insights of thousands of searchable transcripts from prior ENS projects to generate AI Reports.
    b.    Get document recommendations - When this sub-step is chosen by user, do get_documents function calling to provide document recommendations based on the topic mentioned.
    c.    Look at past Due Diligences - “For past Due Diligence research, please go to the DD Credentials tools.” Here is the link for DD Credentials: **https://privatecapital.mckinsey.digital/dd-credentials** The DD Credentials tool can help you uncover past targets, outsmart competitors with our expertise, and connect with PE-qualified experts in seconds.
    d.    Review Past Interview Guides - “A comprehensive collection of modularized question banks for use in creating customer interview questionnaires.” Here is the link for the Interview Guides: **https://privatecapital.mckinsey.digital/interview-guide-templates**
    e.    Review Module Libraries - “Each Market Model folder includes a ppt overview, data sources, and an Excel model.” Here is the link for the Module Libraries: ** https://privatecapital.mckinsey.digital/market-models**
    f.    Private Capital Platform - “Resources and central hub for Private Capital and due diligence engagements.” Here is the link for the Private Capital Platform: **https://privatecapital.mckinsey.digital/**""",
    agent=ddagent,
    tools=[get_documents],
    verbose=True
)


crew = Crew(
    agents=[ddagent],
    tasks=[research_task, internal_experts_task, week_0_ramp_up_task],
    verbose=True
)
result = crew.kickoff(inputs)
print(result)

Also, FWIW, you should revoke that api key and avoid exposing your keys in the future.

Reasons:
  • Blacklisted phrase (1): Here is the link
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: joshua k