Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/19uroojkhan_ai-sales-agent.json
T

1 line
21 KiB
JSON

{"repo": "19uroojkhan/ai-sales-agent", "files": {"AI_Sales_Agent1.ipynb": {"ab840f8c99cb285617eb3b6194ee3a55cd0501c2": {"t": 1785745484.9674916, "n": 19542, "h": "e2c1c38c97cf2ef9", "c": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"\\n\",\n \"\\n\",\n \"Now we get to more detail:\\n\",\n \"\\n\",\n \"1. Different models\\n\",\n \"\\n\",\n \"2. Structured Outputs\\n\",\n \"\\n\",\n \"3. Guardrails\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 2,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"Requirement already satisfied: sendgrid in /opt/anaconda3/lib/python3.12/site-packages (6.12.2)\\n\",\n \"Requirement already satisfied: python-http-client>=3.2.1 in /opt/anaconda3/lib/python3.12/site-packages (from sendgrid) (3.3.7)\\n\",\n \"Requirement already satisfied: ecdsa<1,>=0.19.1 in /opt/anaconda3/lib/python3.12/site-packages (from sendgrid) (0.19.1)\\n\",\n \"Requirement already satisfied: werkzeug>=3.0.0 in /opt/anaconda3/lib/python3.12/site-packages (from sendgrid) (3.0.3)\\n\",\n \"Requirement already satisfied: six>=1.9.0 in /opt/anaconda3/lib/python3.12/site-packages (from ecdsa<1,>=0.19.1->sendgrid) (1.17.0)\\n\",\n \"Requirement already satisfied: MarkupSafe>=2.1.1 in /opt/anaconda3/lib/python3.12/site-packages (from werkzeug>=3.0.0->sendgrid) (3.0.2)\\n\",\n \"Note: you may need to restart the kernel to use updated packages.\\n\"\n ]\n }\n ],\n \"source\": [\n \"pip install sendgrid\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 3,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"from dotenv import load_dotenv\\n\",\n \"from openai import AsyncOpenAI\\n\",\n \"from agents import Agent, Runner, trace, function_tool, OpenAIChatCompletionsModel, input_guardrail, GuardrailFunctionOutput\\n\",\n \"from typing import Dict\\n\",\n \"import sendgrid\\n\",\n \"import os\\n\",\n \"from sendgrid.helpers.mail import Mail, Email, To, Content\\n\",\n \"from pydantic import BaseModel\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 4,\n \"metadata\": {},\n \"outputs\": [\n {\n \"data\": {\n \"text/plain\": [\n \"True\"\n ]\n },\n \"execution_count\": 4,\n \"metadata\": {},\n \"output_type\": \"execute_result\"\n }\n ],\n \"source\": [\n \"load_dotenv(override=True)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 6,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"openai_api_key = os.getenv('OPENAI_API_KEY')\\n\",\n \"google_api_key = os.getenv('GOOGLE_API_KEY')\\n\",\n \"deepseek_api_key = os.getenv('DEEPSEEK_API_KEY')\\n\",\n \"groq_api_key = os.getenv('GROQ_API_KEY')\\n\",\n \"\\n\",\n \"# if openai_api_key:\\n\",\n \"# print(f\\\"OpenAI API Key exists and begins {openai_api_key[:8]}\\\")\\n\",\n \"# else:\\n\",\n \"# print(\\\"OpenAI API Key not set\\\")\\n\",\n \"\\n\",\n \"# if google_api_key:\\n\",\n \"# print(f\\\"Google API Key exists and begins {google_api_key[:2]}\\\")\\n\",\n \"# else:\\n\",\n \"# print(\\\"Google API Key not set (and this is optional)\\\")\\n\",\n \"\\n\",\n \"# if deepseek_api_key:\\n\",\n \"# print(f\\\"DeepSeek API Key exists and begins {deepseek_api_key[:3]}\\\")\\n\",\n \"# else:\\n\",\n \"# print(\\\"DeepSeek API Key not set (and this is optional)\\\")\\n\",\n \"\\n\",\n \"# if groq_api_key:\\n\",\n \"# print(f\\\"Groq API Key exists and begins {groq_api_key[:4]}\\\")\\n\",\n \"# else:\\n\",\n \"# print(\\\"Groq API Key not set (and this is optional)\\\")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 7,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"instructions1 = \\\"You are a sales agent working for ComplAI, \\\\\\n\",\n \"a company that provides a SaaS tool for ensuring SOC2 compliance and preparing for audits, powered by AI. \\\\\\n\",\n \"You write professional, serious cold emails.\\\"\\n\",\n \"\\n\",\n \"instructions2 = \\\"You are a humorous, engaging sales agent working for ComplAI, \\\\\\n\",\n \"a company that provides a SaaS tool for ensuring SOC2 compliance and preparing for audits, powered by AI. \\\\\\n\",\n \"You write witty, engaging cold emails that are likely to get a response.\\\"\\n\",\n \"\\n\",\n \"instructions3 = \\\"You are a busy sales agent working for ComplAI, \\\\\\n\",\n \"a company that provides a SaaS tool for ensuring SOC2 compliance and preparing for audits, powered by AI. \\\\\\n\",\n \"You write concise, to the point cold emails.\\\"\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"### It's easy to use any models with OpenAI compatible endpoints\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 8,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"GEMINI_BASE_URL = \\\"https://generativelanguage.googleapis.com/v1beta/openai/\\\"\\n\",\n \"DEEPSEEK_BASE_URL = \\\"https://api.deepseek.com/v1\\\"\\n\",\n \"GROQ_BASE_URL = \\\"https://api.groq.com/openai/v1\\\"\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 9,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"\\n\",\n \"deepseek_client = AsyncOpenAI(base_url=DEEPSEEK_BASE_URL, api_key=deepseek_api_key)\\n\",\n \"gemini_client = AsyncOpenAI(base_url=GEMINI_BASE_URL, api_key=google_api_key)\\n\",\n \"groq_client = AsyncOpenAI(base_url=GROQ_BASE_URL, api_key=groq_api_key)\\n\",\n \"\\n\",\n \"deepseek_model = OpenAIChatCompletionsModel(model=\\\"deepseek-chat\\\", openai_client=deepseek_client)\\n\",\n \"gemini_model = OpenAIChatCompletionsModel(model=\\\"gemini-2.0-flash\\\", openai_client=gemini_client)\\n\",\n \"llama3_3_model = OpenAIChatCompletionsModel(model=\\\"llama-3.3-70b-versatile\\\", openai_client=groq_client)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 10,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"sales_agent1 = Agent(name=\\\"DeepSeek Sales Agent\\\", instructions=instructions1, model=deepseek_model)\\n\",\n \"sales_agent2 = Agent(name=\\\"Gemini Sales Agent\\\", instructions=instructions2, model=gemini_model)\\n\",\n \"sales_agent3 = Agent(name=\\\"Llama3.3 Sales Agent\\\",instructions=instructions3,model=llama3_3_model)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 11,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"description = \\\"Write a cold sales email\\\"\\n\",\n \"\\n\",\n \"tool1 = sales_agent1.as_tool(tool_name=\\\"sales_agent1\\\", tool_description=description)\\n\",\n \"tool2 = sales_agent2.as_tool(tool_name=\\\"sales_agent2\\\", tool_description=description)\\n\",\n \"tool3 = sales_agent3.as_tool(tool_name=\\\"sales_agent3\\\", tool_description=description)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 12,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"@function_tool\\n\",\n \"def send_html_email(subject: str, html_body: str) -> Dict[str, str]:\\n\",\n \" \\\"\\\"\\\" Send out an email with the given subject and HTML body to all sales prospects \\\"\\\"\\\"\\n\",\n \" sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))\\n\",\n \" from_email = Email(\\\"uroojkhan19786@gmail.com\\\") # Change to your verified sender\\n\",\n \" to_email = To(\\\"urooj.khan@alyssum.global\\\") # Change to your recipient\\n\",\n \" content = Content(\\\"text/html\\\", html_body)\\n\",\n \" mail = Mail(from_email, to_email, subject, content).get()\\n\",\n \" response = sg.client.mail.send.post(request_body=mail)\\n\",\n \" return {\\\"status\\\": \\\"success\\\"}\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 13,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"subject_instructions = \\\"You can write a subject for a cold sales email. \\\\\\n\",\n \"You are given a message and you need to write a subject for an email that is likely to get a response.\\\"\\n\",\n \"\\n\",\n \"html_instructions = \\\"You can convert a text email body to an HTML email body. \\\\\\n\",\n \"You are given a text email body which might have some markdown \\\\\\n\",\n \"and you need to convert it to an HTML email body with simple, clear, compelling layout and design.\\\"\\n\",\n \"\\n\",\n \"subject_writer = Agent(name=\\\"Email subject writer\\\", instructions=subject_instructions, model=\\\"gpt-4o-mini\\\")\\n\",\n \"subject_tool = subject_writer.as_tool(tool_name=\\\"subject_writer\\\", tool_description=\\\"Write a subject for a cold sales email\\\")\\n\",\n \"\\n\",\n \"html_converter = Agent(name=\\\"HTML email body converter\\\", instructions=html_instructions, model=\\\"gpt-4o-mini\\\")\\n\",\n \"html_tool = html_converter.as_tool(tool_name=\\\"html_converter\\\",tool_description=\\\"Convert a text email body to an HTML email body\\\")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 14,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"email_tools = [subject_tool, html_tool, send_html_email]\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 15,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"instructions =\\\"You are an email formatter and sender. You receive the body of an email to be sent. \\\\\\n\",\n \"You first use the subject_writer tool to write a subject for the email, then use the html_converter tool to convert the body to HTML. \\\\\\n\",\n \"Finally, you use the send_html_email tool to send the email with the subject and HTML body.\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"emailer_agent = Agent(\\n\",\n \" name=\\\"Email Manager\\\",\\n\",\n \" instructions=instructions,\\n\",\n \" tools=email_tools,\\n\",\n \" model=\\\"gpt-4o-mini\\\",\\n\",\n \" handoff_description=\\\"Convert an email to HTML and send it\\\")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 16,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"tools = [tool1, tool2, tool3]\\n\",\n \"handoffs = [emailer_agent]\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 24,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"sales_manager_instructions = \\\"You are a sales manager working for ComplAI. You use the tools given to you to generate cold sales emails. \\\\\\n\",\n \"You never generate sales emails yourself; you always use the tools. \\\\\\n\",\n \"You try all 3 sales agent tools at least once before choosing the best one. \\\\\\n\",\n \"You can use the tools multiple times if you're not satisfied with the results from the first try. \\\\\\n\",\n \"You select the single best email using your own judgement of which email will be most effective. \\\\\\n\",\n \"After picking the email, you handoff to the Email Manager agent to format and send the email.\\\"\\n\",\n \"\\n\",\n \"\\n\",\n \"sales_manager = Agent(\\n\",\n \" name=\\\"Sales Manager\\\",\\n\",\n \" instructions=sales_manager_instructions,\\n\",\n \" tools=tools,\\n\",\n \" handoffs=handoffs,\\n\",\n \" model=\\\"gpt-4o-mini\\\")\\n\",\n \"\\n\",\n \"message = \\\"Send out a cold sales email addressed to Dear CEO from Alice\\\"\\n\",\n \"\\n\",\n \"with trace(\\\"Automated SDR\\\"):\\n\",\n \" result = await Runner.run(sales_manager, message)\\n\",\n \" print(result)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 23,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"class NameCheckOutput(BaseModel):\\n\",\n \" is_name_in_message: bool\\n\",\n \" name: str\\n\",\n \"\\n\",\n \"guardrail_agent = Agent( \\n\",\n \" name=\\\"Name check\\\",\\n\",\n \" instructions=\\\"Check if the user is including someone's personal name in what they want you to do.\\\",\\n\",\n \" output_type=NameCheckOutput,\\n\",\n \" model=\\\"gpt-4o-mini\\\"\\n\",\n \")\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 22,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"@input_guardrail\\n\",\n \"async def guardrail_against_name(ctx, agent, message):\\n\",\n \" result = await Runner.run(guardrail_agent, message, context=ctx.context)\\n\",\n \" is_name_in_message = result.final_output.is_name_in_message\\n\",\n \" return GuardrailFunctionOutput(output_info={\\\"found_name\\\": result.final_output},tripwire_triggered=is_name_in_message)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 25,\n \"metadata\": {},\n \"outputs\": [\n {\n \"ename\": \"InputGuardrailTripwireTriggered\",\n \"evalue\": \"Guardrail InputGuardrail triggered tripwire\",\n \"output_type\": \"error\",\n \"traceback\": [\n \"\\u001b[0;31m---------------------------------------------------------------------------\\u001b[0m\",\n \"\\u001b[0;31mInputGuardrailTripwireTriggered\\u001b[0m Traceback (most recent call last)\",\n \"Cell \\u001b[0;32mIn[25], line 13\\u001b[0m\\n\\u001b[1;32m 10\\u001b[0m message \\u001b[38;5;241m=\\u001b[39m \\u001b[38;5;124m\\\"\\u001b[39m\\u001b[38;5;124mSend out a cold sales email addressed to Dear CEO from Alice\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m\\n\\u001b[1;32m 12\\u001b[0m \\u001b[38;5;28;01mwith\\u001b[39;00m trace(\\u001b[38;5;124m\\\"\\u001b[39m\\u001b[38;5;124mProtected Automated SDR\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m):\\n\\u001b[0;32m---> 13\\u001b[0m result \\u001b[38;5;241m=\\u001b[39m \\u001b[38;5;28;01mawait\\u001b[39;00m Runner\\u001b[38;5;241m.\\u001b[39mrun(careful_sales_manager, message)\\n\",\n \"File \\u001b[0;32m/opt/anaconda3/lib/python3.12/site-packages/agents/run.py:218\\u001b[0m, in \\u001b[0;36mRunner.run\\u001b[0;34m(cls, starting_agent, input, context, max_turns, hooks, run_config, previous_response_id)\\u001b[0m\\n\\u001b[1;32m 213\\u001b[0m logger\\u001b[38;5;241m.\\u001b[39mdebug(\\n\\u001b[1;32m 214\\u001b[0m \\u001b[38;5;124mf\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m\\u001b[38;5;124mRunning agent \\u001b[39m\\u001b[38;5;132;01m{\\u001b[39;00mcurrent_agent\\u001b[38;5;241m.\\u001b[39mname\\u001b[38;5;132;01m}\\u001b[39;00m\\u001b[38;5;124m (turn \\u001b[39m\\u001b[38;5;132;01m{\\u001b[39;00mcurrent_turn\\u001b[38;5;132;01m}\\u001b[39;00m\\u001b[38;5;124m)\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m,\\n\\u001b[1;32m 215\\u001b[0m )\\n\\u001b[1;32m 217\\u001b[0m \\u001b[38;5;28;01mif\\u001b[39;00m current_turn \\u001b[38;5;241m==\\u001b[39m \\u001b[38;5;241m1\\u001b[39m:\\n\\u001b[0;32m--> 218\\u001b[0m input_guardrail_results, turn_result \\u001b[38;5;241m=\\u001b[39m \\u001b[38;5;28;01mawait\\u001b[39;00m asyncio\\u001b[38;5;241m.\\u001b[39mgather(\\n\\u001b[1;32m 219\\u001b[0m \\u001b[38;5;28mcls\\u001b[39m\\u001b[38;5;241m.\\u001b[39m_run_input_guardrails(\\n\\u001b[1;32m 220\\u001b[0m starting_agent,\\n\\u001b[1;32m 221\\u001b[0m starting_agent\\u001b[38;5;241m.\\u001b[39minput_guardrails\\n\\u001b[1;32m 222\\u001b[0m \\u001b[38;5;241m+\\u001b[39m (run_config\\u001b[38;5;241m.\\u001b[39minput_guardrails \\u001b[38;5;129;01mor\\u001b[39;00m []),\\n\\u001b[1;32m 223\\u001b[0m copy\\u001b[38;5;241m.\\u001b[39mdeepcopy(\\u001b[38;5;28minput\\u001b[39m),\\n\\u001b[1;32m 224\\u001b[0m context_wrapper,\\n\\u001b[1;32m 225\\u001b[0m ),\\n\\u001b[1;32m 226\\u001b[0m \\u001b[38;5;28mcls\\u001b[39m\\u001b[38;5;241m.\\u001b[39m_run_single_turn(\\n\\u001b[1;32m 227\\u001b[0m agent\\u001b[38;5;241m=\\u001b[39mcurrent_agent,\\n\\u001b[1;32m 228\\u001b[0m all_tools\\u001b[38;5;241m=\\u001b[39mall_tools,\\n\\u001b[1;32m 229\\u001b[0m original_input\\u001b[38;5;241m=\\u001b[39moriginal_input,\\n\\u001b[1;32m 230\\u001b[0m generated_items\\u001b[38;5;241m=\\u001b[39mgenerated_items,\\n\\u001b[1;32m 231\\u001b[0m hooks\\u001b[38;5;241m=\\u001b[39mhooks,\\n\\u001b[1;32m 232\\u001b[0m context_wrapper\\u001b[38;5;241m=\\u001b[39mcontext_wrapper,\\n\\u001b[1;32m 233\\u001b[0m run_config\\u001b[38;5;241m=\\u001b[39mrun_config,\\n\\u001b[1;32m 234\\u001b[0m should_run_agent_start_hooks\\u001b[38;5;241m=\\u001b[39mshould_run_agent_start_hooks,\\n\\u001b[1;32m 235\\u001b[0m tool_use_tracker\\u001b[38;5;241m=\\u001b[39mtool_use_tracker,\\n\\u001b[1;32m 236\\u001b[0m previous_response_id\\u001b[38;5;241m=\\u001b[39mprevious_response_id,\\n\\u001b[1;32m 237\\u001b[0m ),\\n\\u001b[1;32m 238\\u001b[0m )\\n\\u001b[1;32m 239\\u001b[0m \\u001b[38;5;28;01melse\\u001b[39;00m:\\n\\u001b[1;32m 240\\u001b[0m turn_result \\u001b[38;5;241m=\\u001b[39m \\u001b[38;5;28;01mawait\\u001b[39;00m \\u001b[38;5;28mcls\\u001b[39m\\u001b[38;5;241m.\\u001b[39m_run_single_turn(\\n\\u001b[1;32m 241\\u001b[0m agent\\u001b[38;5;241m=\\u001b[39mcurrent_agent,\\n\\u001b[1;32m 242\\u001b[0m all_tools\\u001b[38;5;241m=\\u001b[39mall_tools,\\n\\u001b[0;32m (...)\\u001b[0m\\n\\u001b[1;32m 250\\u001b[0m previous_response_id\\u001b[38;5;241m=\\u001b[39mprevious_response_id,\\n\\u001b[1;32m 251\\u001b[0m )\\n\",\n \"File \\u001b[0;32m/opt/anaconda3/lib/python3.12/site-packages/agents/run.py:857\\u001b[0m, in \\u001b[0;36mRunner._run_input_guardrails\\u001b[0;34m(cls, agent, guardrails, input, context)\\u001b[0m\\n\\u001b[1;32m 850\\u001b[0m t\\u001b[38;5;241m.\\u001b[39mcancel()\\n\\u001b[1;32m 851\\u001b[0m _error_tracing\\u001b[38;5;241m.\\u001b[39mattach_error_to_current_span(\\n\\u001b[1;32m 852\\u001b[0m SpanError(\\n\\u001b[1;32m 853\\u001b[0m message\\u001b[38;5;241m=\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m\\u001b[38;5;124mGuardrail tripwire triggered\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m,\\n\\u001b[1;32m 854\\u001b[0m data\\u001b[38;5;241m=\\u001b[39m{\\u001b[38;5;124m\\\"\\u001b[39m\\u001b[38;5;124mguardrail\\u001b[39m\\u001b[38;5;124m\\\"\\u001b[39m: result\\u001b[38;5;241m.\\u001b[39mguardrail\\u001b[38;5;241m.\\u001b[39mget_name()},\\n\\u001b[1;32m 855\\u001b[0m )\\n\\u001b[1;32m 856\\u001b[0m )\\n\\u001b[0;32m--> 857\\u001b[0m \\u001b[38;5;28;01mraise\\u001b[39;00m InputGuardrailTripwireTriggered(result)\\n\\u001b[1;32m 858\\u001b[0m \\u001b[38;5;28;01melse\\u001b[39;00m:\\n\\u001b[1;32m 859\\u001b[0m guardrail_results\\u001b[38;5;241m.\\u001b[39mappend(result)\\n\",\n \"\\u001b[0;31mInputGuardrailTripwireTriggered\\u001b[0m: Guardrail InputGuardrail triggered tripwire\"\n ]\n }\n ],\n \"source\": [\n \"careful_sales_manager = Agent(\\n\",\n \" name=\\\"Sales Manager\\\",\\n\",\n \" instructions=sales_manager_instructions,\\n\",\n \" tools=tools,\\n\",\n \" handoffs=[emailer_agent],\\n\",\n \" model=\\\"gpt-4o-mini\\\",\\n\",\n \" input_guardrails=[guardrail_against_name]\\n\",\n \" )\\n\",\n \"\\n\",\n \"message = \\\"Send out a cold sales email addressed to Dear CEO from Alice\\\"\\n\",\n \"\\n\",\n \"with trace(\\\"Protected Automated SDR\\\"):\\n\",\n \" result = await Runner.run(careful_sales_manager, message)\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": 26,\n \"metadata\": {},\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"RunResult:\\n\",\n \"- Last agent: Agent(name=\\\"Email Manager\\\", ...)\\n\",\n \"- Final output (str):\\n\",\n \" The cold sales email has been successfully sent! If you need any further assistance or modifications, feel free to ask.\\n\",\n \"- 21 new item(s)\\n\",\n \"- 6 raw response(s)\\n\",\n \"- 1 input guardrail result(s)\\n\",\n \"- 0 output guardrail result(s)\\n\",\n \"(See `RunResult` for more details)\\n\"\n ]\n }\n ],\n \"source\": [\n \"\\n\",\n \"message = \\\"Send out a cold sales email addressed to Dear CEO from Head of Business Development\\\"\\n\",\n \"\\n\",\n \"with trace(\\\"Protected Automated SDR\\\"):\\n\",\n \" result = await Runner.run(careful_sales_manager, message)\\n\",\n \" print(result)\"\n ]\n },\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": []\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \".venv\",\n \"language\": \"python\",\n \"name\": \"python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.12.4\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"}}}}