From 64e1af7acf228d0c016618291e21a76f79925855 Mon Sep 17 00:00:00 2001 From: Sanjay Semwal Date: Wed, 27 Nov 2024 00:29:56 -0800 Subject: [PATCH] week1 exercise --- week1/day2 EXERCISE.ipynb | 44 +- week1/day5.ipynb | 1226 +++++++++++++++++++++++++++++++++++- week1/week1 EXERCISE.ipynb | 927 ++++++++++++++++++++++++++- 3 files changed, 2127 insertions(+), 70 deletions(-) diff --git a/week1/day2 EXERCISE.ipynb b/week1/day2 EXERCISE.ipynb index ef8c9cd..d6acfba 100644 --- a/week1/day2 EXERCISE.ipynb +++ b/week1/day2 EXERCISE.ipynb @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 43, "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd", "metadata": {}, "outputs": [], @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 44, "id": "29ddd15d-a3c5-4f4e-a678-873f56162724", "metadata": {}, "outputs": [], @@ -96,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 45, "id": "dac0a679-599c-441f-9bf2-ddc73d35b940", "metadata": {}, "outputs": [], @@ -110,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 46, "id": "7bb9c624-14f0-4945-a719-8ddb64f66f47", "metadata": {}, "outputs": [], @@ -124,7 +124,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 47, "id": "42b9f644-522d-4e05-a691-56e7658c0ea9", "metadata": {}, "outputs": [ @@ -134,27 +134,25 @@ "text": [ "Generative AI has numerous business applications across various industries, including:\n", "\n", - "1. **Content Creation**: Generative AI can generate high-quality content such as articles, social media posts, product descriptions, and more. This can help reduce content creation costs and increase efficiency.\n", - "2. **Image and Video Generation**: Generative AI can create realistic images and videos for use in marketing campaigns, advertising, and product demonstrations.\n", - "3. **Customer Service Chatbots**: Generative AI-powered chatbots can be used to provide customer support, answering frequently asked questions, and helping customers with simple issues.\n", - "4. **Personalized Recommendations**: Generative AI algorithms can analyze customer behavior and preferences to generate personalized recommendations for products, services, or content.\n", - "5. **Product Design and Prototyping**: Generative AI can aid in product design and prototyping by generating multiple design options, reducing the need for physical prototypes and speeding up the design process.\n", - "6. **Supply Chain Optimization**: Generative AI can analyze supply chain data to predict demand, optimize inventory levels, and identify potential bottlenecks.\n", - "7. **Marketing Automation**: Generative AI can automate repetitive marketing tasks such as email campaigns, social media posts, and ad targeting.\n", - "8. **Data Analysis and Insights**: Generative AI algorithms can analyze large datasets to identify trends, patterns, and insights that may not be apparent through human analysis alone.\n", - "9. **Financial Modeling and Forecasting**: Generative AI can help forecast sales, revenue, and expenses by analyzing historical data and identifying potential risks and opportunities.\n", - "10. **Cybersecurity Threat Detection**: Generative AI-powered systems can analyze network traffic and identify potential security threats in real-time.\n", - "11. **Creative Writing and Editing**: Generative AI can assist writers with content creation, editing, and proofreading tasks such as suggesting alternative phrases or sentence structures.\n", - "12. **Human Resources Management**: Generative AI can help automate HR tasks such as recruitment, talent management, and performance evaluations.\n", + "1. **Content Generation**: AI-powered tools can create high-quality content such as articles, social media posts, product descriptions, and more. This can help reduce content creation costs and increase productivity.\n", + "2. **Image and Video Generation**: Generative AI can produce realistic images and videos for advertising, marketing, and other purposes, reducing the need for expensive photography or video production services.\n", + "3. **Product Design and Development**: AI-powered tools can generate 3D models, product designs, and prototypes, accelerating the product development process and improving design efficiency.\n", + "4. **Customer Service Chatbots**: Generative AI can create conversational chatbots that provide personalized customer support, helping to improve customer satisfaction and reduce response times.\n", + "5. **Marketing Automation**: AI-powered tools can generate personalized marketing messages, subject lines, and email content, increasing the effectiveness of marketing campaigns.\n", + "6. **Data Analysis and Visualization**: Generative AI can help analyze large datasets, identify patterns, and create visualizations that make complex data insights more accessible to non-technical stakeholders.\n", + "7. **Language Translation**: AI-powered tools can generate high-quality translations for businesses operating in multiple languages, reducing translation costs and improving communication with customers.\n", + "8. **Music and Audio Generation**: Generative AI can create original music, sound effects, and audio content for advertising, film, and other applications.\n", + "9. **Automated Writing Assistants**: AI-powered tools can assist writers with research, suggestions, and even entire drafts, helping to improve writing efficiency and quality.\n", + "10. **Predictive Analytics**: Generative AI can analyze large datasets to predict future trends, behaviors, and outcomes, enabling businesses to make more informed decisions.\n", "\n", - "Some specific business use cases for Generative AI include:\n", + "Some specific business applications of Generative AI include:\n", "\n", - "* **Virtual assistants**: Companies like Google and Microsoft are using Generative AI to create virtual assistants that can understand natural language queries and provide personalized responses.\n", - "* **Personalized product recommendations**: Retailers like Amazon and Apple are using Generative AI to generate personalized product recommendations based on customer behavior and preferences.\n", - "* **Automated marketing campaigns**: Marketers are using Generative AI to automate repetitive marketing tasks such as email campaigns, social media posts, and ad targeting.\n", - "* **Predictive maintenance**: Manufacturers are using Generative AI to predict equipment failures and schedule maintenance accordingly, reducing downtime and increasing efficiency.\n", + "* **Amazon's Product Recommendations**: Amazon uses Generative AI to recommend products based on customer behavior and preferences.\n", + "* **Google's Image Search**: Google's image search engine uses Generative AI to provide accurate and relevant image results.\n", + "* **Hulu's Content Generation**: Hulu uses Generative AI to create personalized content recommendations for its users.\n", + "* **Microsoft's Azure AI**: Microsoft offers a range of AI-powered tools, including Generative AI, to help businesses improve their products and services.\n", "\n", - "These are just a few examples of the many business applications of Generative AI. As the technology continues to evolve, we can expect to see even more innovative use cases emerge.\n" + "These are just a few examples of the many business applications of Generative AI. As the technology continues to evolve, we can expect to see even more innovative uses in various industries.\n" ] } ], diff --git a/week1/day5.ipynb b/week1/day5.ipynb index 037e278..c0b5270 100644 --- a/week1/day5.ipynb +++ b/week1/day5.ipynb @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "d5b08506-dc8b-4443-9201-5f1848161363", "metadata": {}, "outputs": [], @@ -42,10 +42,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "fc5d8880-f2ee-4c06-af16-ecbc0262af61", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "API key looks good so far\n" + ] + } + ], "source": [ "# Initialize and constants\n", "\n", @@ -63,7 +71,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "106dd65e-90af-4ca8-86b6-23a41840645b", "metadata": {}, "outputs": [], @@ -96,12 +104,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "e30d8128-933b-44cc-81c8-ab4c9d86589a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "['/cart',\n", + " '#page',\n", + " '/',\n", + " '#services',\n", + " '#about',\n", + " '#contact',\n", + " '/',\n", + " '#services',\n", + " '#about',\n", + " '#contact',\n", + " '#services',\n", + " '#about',\n", + " '#contact',\n", + " '#services',\n", + " 'http://squarespace.com']" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "ed = Website(\"https://edwarddonner.com\")\n", + "ed = Website(\"https://www.jaivikhimalay.com\")\n", "ed.links" ] }, @@ -123,7 +156,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "6957b079-0d96-45f7-a26a-3487510e9b35", "metadata": {}, "outputs": [], @@ -144,17 +177,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "b97e4068-97ed-4120-beae-c42105e4d59a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You are provided with a list of links found on a webpage. You are able to decide which of the links would be most relevant to include in a brochure about the company, such as links to an About page, or a Company page, or Careers/Jobs pages.\n", + "You should respond in JSON as in this example:\n", + "{\n", + " \"links\": [\n", + " {\"type\": \"about page\", \"url\": \"https://full.url/goes/here/about\"},\n", + " {\"type\": \"careers page\": \"url\": \"https://another.full.url/careers\"}\n", + " ]\n", + "}\n", + "\n" + ] + } + ], "source": [ "print(link_system_prompt)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "8e1f601b-2eaf-499d-b6b8-c99050c9d6b3", "metadata": {}, "outputs": [], @@ -170,17 +219,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "6bcbfa78-6395-4685-b92c-22d592050fd7", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Here is the list of links on the website of https://www.jaivikhimalay.com - please decide which of these are relevant web links for a brochure about the company, respond with the full https URL in JSON format. Do not include Terms of Service, Privacy, email links.\n", + "Links (some might be relative links):\n", + "/cart\n", + "#page\n", + "/\n", + "#services\n", + "#about\n", + "#contact\n", + "/\n", + "#services\n", + "#about\n", + "#contact\n", + "#services\n", + "#about\n", + "#contact\n", + "#services\n", + "http://squarespace.com\n" + ] + } + ], "source": [ "print(get_links_user_prompt(ed))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "a29aca19-ca13-471c-a4b4-5abbfa813f69", "metadata": {}, "outputs": [], @@ -201,10 +274,64 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "74a827a0-2782-4ae5-b210-4a242a8b4cc2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "['/',\n", + " '/claude',\n", + " '/team',\n", + " '/enterprise',\n", + " '/api',\n", + " '/pricing',\n", + " '/research',\n", + " '/company',\n", + " '/careers',\n", + " '/news',\n", + " 'https://www.anthropic.com/research#entry:8@1:url',\n", + " 'https://www.anthropic.com/claude',\n", + " 'https://claude.ai/',\n", + " '/api',\n", + " '/news/3-5-models-and-computer-use',\n", + " '/claude/sonnet',\n", + " '/claude/haiku',\n", + " '/news/claude-for-enterprise',\n", + " '/research/constitutional-ai-harmlessness-from-ai-feedback',\n", + " '/news/core-views-on-ai-safety',\n", + " '/jobs',\n", + " '/',\n", + " '/claude',\n", + " '/api',\n", + " '/team',\n", + " '/pricing',\n", + " '/research',\n", + " '/company',\n", + " '/customers',\n", + " '/news',\n", + " '/careers',\n", + " 'mailto:press@anthropic.com',\n", + " 'https://support.anthropic.com/',\n", + " 'https://status.anthropic.com/',\n", + " '/supported-countries',\n", + " 'https://twitter.com/AnthropicAI',\n", + " 'https://www.linkedin.com/company/anthropicresearch',\n", + " 'https://www.youtube.com/@anthropic-ai',\n", + " '/legal/consumer-terms',\n", + " '/legal/commercial-terms',\n", + " '/legal/privacy',\n", + " '/legal/aup',\n", + " '/responsible-disclosure-policy',\n", + " 'https://trust.anthropic.com/']" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anthropic = Website(\"https://anthropic.com\")\n", "anthropic.links" @@ -212,10 +339,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "d3d583e2-dcc4-40cc-9b28-1e8dbf402924", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'links': [{'type': 'about page', 'url': 'https://anthropic.com/company'},\n", + " {'type': 'careers page', 'url': 'https://anthropic.com/careers'},\n", + " {'type': 'team page', 'url': 'https://anthropic.com/team'},\n", + " {'type': 'research page', 'url': 'https://anthropic.com/research'},\n", + " {'type': 'news page', 'url': 'https://anthropic.com/news'}]}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "get_links(\"https://anthropic.com\")" ] @@ -232,7 +374,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "85a5b6e2-e7ef-44a9-bc7f-59ede71037b5", "metadata": {}, "outputs": [], @@ -250,17 +392,788 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "5099bd14-076d-4745-baf3-dac08d8e5ab2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://www.anthropic.com/company'}, {'type': 'careers page', 'url': 'https://www.anthropic.com/careers'}, {'type': 'team page', 'url': 'https://www.anthropic.com/team'}, {'type': 'research page', 'url': 'https://www.anthropic.com/research'}, {'type': 'news page', 'url': 'https://www.anthropic.com/news'}]}\n", + "Landing page:\n", + "Webpage Title:\n", + "Home \\ Anthropic\n", + "Webpage Contents:\n", + "Claude\n", + "Overview\n", + "Team\n", + "Enterprise\n", + "API\n", + "Pricing\n", + "Research\n", + "Company\n", + "Careers\n", + "News\n", + "AI\n", + "research\n", + "and\n", + "products\n", + "that put safety at the frontier\n", + "Claude.ai\n", + "Meet Claude 3.5 Sonnet\n", + "Claude 3.5 Sonnet, our most intelligent AI model, is now available.\n", + "Talk to Claude\n", + "API\n", + "Build with Claude\n", + "Start using Claude to drive efficiency and create new revenue streams.\n", + "Learn more\n", + "Announcements\n", + "Introducing computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku\n", + "Oct 22, 2024\n", + "Model updates\n", + "3.5 Sonnet\n", + "3.5 Haiku\n", + "Our Work\n", + "Product\n", + "Claude for Enterprise\n", + "Sep 4, 2024\n", + "Alignment\n", + "·\n", + "Research\n", + "Constitutional AI: Harmlessness from AI Feedback\n", + "Dec 15, 2022\n", + "Announcements\n", + "Core Views on AI Safety: When, Why, What, and How\n", + "Mar 8, 2023\n", + "Work with Anthropic\n", + "Anthropic is an AI safety and research company based in San Francisco. Our interdisciplinary team has experience across ML, physics, policy, and product. Together, we generate research and create reliable, beneficial AI systems.\n", + "See open roles\n", + "Claude\n", + "API\n", + "Team\n", + "Pricing\n", + "Research\n", + "Company\n", + "Customers\n", + "News\n", + "Careers\n", + "Press Inquiries\n", + "Support\n", + "Status\n", + "Availability\n", + "Twitter\n", + "LinkedIn\n", + "YouTube\n", + "Terms of Service – Consumer\n", + "Terms of Service – Commercial\n", + "Privacy Policy\n", + "Usage Policy\n", + "Responsible Disclosure Policy\n", + "Compliance\n", + "Privacy Choices\n", + "© 2024 Anthropic PBC\n", + "\n", + "\n", + "\n", + "about page\n", + "Webpage Title:\n", + "Company \\ Anthropic\n", + "Webpage Contents:\n", + "Claude\n", + "Overview\n", + "Team\n", + "Enterprise\n", + "API\n", + "Pricing\n", + "Research\n", + "Company\n", + "Careers\n", + "News\n", + "Making AI systems\n", + "you can rely on\n", + "Anthropic is an AI safety and research company. We build reliable, interpretable, and steerable AI systems.\n", + "Join us\n", + "Our Purpose\n", + "We believe AI will have a vast impact on the world. Anthropic is dedicated to building systems that people can rely on and generating research about the opportunities and risks of AI.\n", + "We Build Safer Systems\n", + "We aim to build frontier AI systems that are reliable, interpretable, and steerable. We conduct frontier research, develop and apply a variety of safety techniques, and deploy the resulting systems via a set of partnerships and products.\n", + "Safety Is a Science\n", + "We treat AI safety as a systematic science, conducting research, applying it to our products, feeding those insights back into our research, and regularly sharing what we learn with the world along the way.\n", + "Interdisciplinary\n", + "Anthropic is a collaborative team of researchers, engineers, policy experts, business leaders and operators, who bring our experience from many different domains to our work.\n", + "AI Companies are One Piece of a Big Puzzle\n", + "AI has the potential to fundamentally change how the world works. We view ourselves as just one piece of this evolving puzzle. We collaborate with civil society, government, academia, nonprofits and industry to promote safety industry-wide.\n", + "The Team\n", + "We’re a team of researchers, engineers, policy experts and operational leaders, with experience spanning a variety of disciplines, all working together to build reliable and understandable AI systems.\n", + "Research\n", + "We conduct frontier AI research across a variety of modalities, and explore novel and emerging safety research areas from interpretability to RL from human feedback to policy and societal impacts analysis.\n", + "Policy\n", + "We think about the impacts of our work and strive to communicate what we’re seeing at the frontier to policymakers and civil society in the US and abroad to help promote safe and reliable AI.\n", + "Product\n", + "We translate our research into tangible, practical tools like Claude that benefit businesses, nonprofits and civil society groups and their clients and people around the globe.\n", + "Operations\n", + "Our people, finance, legal, and recruiting teams are the human engines that make Anthropic go. We’ve had previous careers at NASA, startups, and the armed forces and our diverse experiences help make Anthropic a great place to work (and we love plants!).\n", + "Our Values\n", + "01\n", + "Here for the mission\n", + "Anthropic exists for our mission: to ensure transformative AI helps people and society flourish. Progress this decade may be rapid, and we expect increasingly capable systems to pose novel challenges. We pursue our mission by building frontier systems, studying their behaviors, working to responsibly deploy them, and regularly sharing our safety insights. We collaborate with other projects and stakeholders seeking a similar outcome.\n", + "02\n", + "Unusually high trust\n", + "Our company is an unusually high trust environment: we assume good faith, disagree kindly, and prioritize honesty. We expect emotional maturity and intellectual openness. At its best, our trust enables us to make better decisions as an organization than any one of us could as individuals.\n", + "03\n", + "One big team\n", + "Collaboration is central to our work, culture, and value proposition. While we have many teams at Anthropic, we feel the broader sense in which we are all on the same team working together towards the mission. Leadership sets the strategy, with broad input from everyone, and trusts each piece of the organization to pursue these goals in their unique style. Individuals commonly contribute to work across many different areas.\n", + "04\n", + "Do the simple thing that works\n", + "We celebrate trying the simple thing before the clever, novel thing. We embrace pragmatism - sensible, practical approaches that acknowledge tradeoffs. We love empiricism - finding out what actually works by trying it - and apply this to our research, our engineering and our collaboration. We aim to be open about what we understand and what we don’t.\n", + "Governance\n", + "Anthropic is a Public Benefit Corporation, whose purpose is the responsible development and maintenance of advanced AI for the long-term benefit of humanity. Our Board of Directors is elected by stockholders and our Long-Term Benefit Trust, as explained\n", + "here.\n", + "Current members of the Board and the Long-Term Benefit Trust (LTBT) are listed below.\n", + "Anthropic Board of Directors\n", + "Dario Amodei, Daniela Amodei, Yasmin Razavi, and Jay Kreps.\n", + "LTBT Trustees\n", + "Neil Buddy Shah, Kanika Bahl, and Zach Robinson.\n", + "Company News\n", + "See All\n", + "Announcements\n", + "Introducing the Model Context Protocol\n", + "Nov 25, 2024\n", + "Announcements\n", + "Powering the next generation of AI development with AWS\n", + "Nov 22, 2024\n", + "Announcements\n", + "Claude 3.5 Sonnet on GitHub Copilot\n", + "Oct 29, 2024\n", + "Want to help us build the future of safe AI?\n", + "Join us\n", + "Claude\n", + "API\n", + "Team\n", + "Pricing\n", + "Research\n", + "Company\n", + "Customers\n", + "News\n", + "Careers\n", + "Press Inquiries\n", + "Support\n", + "Status\n", + "Availability\n", + "Twitter\n", + "LinkedIn\n", + "YouTube\n", + "Terms of Service – Consumer\n", + "Terms of Service – Commercial\n", + "Privacy Policy\n", + "Usage Policy\n", + "Responsible Disclosure Policy\n", + "Compliance\n", + "Privacy Choices\n", + "© 2024 Anthropic PBC\n", + "\n", + "\n", + "\n", + "careers page\n", + "Webpage Title:\n", + "Careers \\ Anthropic\n", + "Webpage Contents:\n", + "Claude\n", + "Overview\n", + "Team\n", + "Enterprise\n", + "API\n", + "Pricing\n", + "Research\n", + "Company\n", + "Careers\n", + "News\n", + "Join the team\n", + "making AI safe\n", + "We’re a public benefit corporation headquartered in San Francisco. Our team’s experience spans a variety of backgrounds and disciplines, from physics and machine learning to public policy and business. We work as a cohesive team that collectively forecasts the impact and tractability of research ideas in advancing our mission.\n", + "See open roles\n", + "What We Offer\n", + "Health & Wellness\n", + "At Anthropic, we believe that supporting our employees is crucial to our collective success and wellbeing. That's why we offer a range of benefits to best support you and your family, now and in the future.\n", + "Comprehensive health, dental, and vision insurance for you and your dependents\n", + "Inclusive fertility benefits via Carrot Fertility\n", + "22 weeks of paid parental leave\n", + "Flexible paid time off and absence policies\n", + "Generous mental health support for you and your dependents\n", + "Compensation & Support\n", + "Our goal is to foster an environment where you can thrive professionally while feeling confident that you and your loved ones are taken care of.\n", + "Competitive salary and equity packages\n", + "Optional equity donation matching at a 1:1 ratio, up to 25% of your equity grant\n", + "Robust retirement plans and salary sacrifice programs with market competitive matching\n", + "Life and income protection plans\n", + "Additional Benefits\n", + "$500/month flexible wellness and time saver stipend\n", + "Commuter benefits\n", + "Annual education stipend\n", + "Home office stipends\n", + "Relocation support for those moving for Anthropic\n", + "Daily meals and snacks in the office\n", + "How We Hire\n", + "The interview process at Anthropic varies based on role and candidate, but our standard process looks like this:\n", + "Step 1\n", + "Resume\n", + "Submit your resume via our website.\n", + "Step 2\n", + "Exploratory chat\n", + "You’ll have a chat with one of our staff to discuss your career interests and relevant experience, and learn more about Anthropic.\n", + "Step 3\n", + "Skills Assessment\n", + "For technical roles, you’ll have a one-hour technical screening interview.\n", + "For operations or policy roles, you’ll get a take-home assignment. These typically involve writing responses to several role-relevant questions; they may occasionally require some outside research. Assignments usually take between 2-5 hours, depending on the role.\n", + "We include this to minimize bias and make well-informed hiring decisions. We think seeing a candidate’s work helps us assess how they might actually perform on the job; similarly, the assignment gives candidates a better idea of what their work at Anthropic might entail. If a candidate likes working through their take-home, that is one indicator that they would enjoy taking on the role, and vice versa.\n", + "We recognize that completing work assignments requires time and effort, and that they are not perfectly reflective of the role’s work. Nonetheless, we think that work tests are a useful complement to interviews and reference checks.\n", + "Step 4\n", + "Team Screen\n", + "You'll have a conversation with either the Hiring Manager or a member of your potential team.\n", + "Step 5\n", + "Interview Panel\n", + "For technical roles, you’ll have 3-4 more one-hour technical interviews, plus a culture interview.\n", + "For operations or policy roles, you’ll have 3-5 hours of interviews, including a culture interview.\n", + "Step 6\n", + "Final Checks\n", + "We’ll ask for some references, and have you chat with our leadership.\n", + "Step 7\n", + "Offer\n", + "We’ll make you an offer!\n", + "Technical Interviews\n", + "The novel challenges we think about at Anthropic demand diverse expertise and perspectives. Our interview process is designed to identify thoughtful candidates who bring unique strengths to our multidisciplinary team. If you think this may describe you, we’d love to hear from you regardless of your background or experience.\n", + "One of the most common questions we get is about whether it is worth applying to work at Anthropic if you have not worked on modern machine learning systems in the past. Yes! For some roles, ML experience is expected, but many technical staff have arrived at Anthropic with no machine learning experience. If you aren’t sure about the ML experience needed for your role, ask your recruiter.\n", + "We use shared environments like Colab and Replit for our programming-focused interviews. We’ll be very interested in how you think through each problem and analyze the tradeoffs between possible approaches, and we’ll also expect you to write, run, and debug your solutions. You’ll be allowed to look things up in documentation or on the web, just like you usually can (which is why we’ll ask you to share your screen throughout each interview); but it’s still important to be familiar with basic syntax, standard libraries, and common idioms in the language you’re interviewing in, so that looking things up doesn’t consume too much time. Your interview process will also include non-technical questions about your experience and what motivates you, and, of course, you’ll have time to ask us about Anthropic! We can’t wait to meet you.\n", + "Other Things\n", + "Engineers here do lots of research, and researchers do lots of engineering\n", + "While there’s historically been a division between engineering and research in machine learning, we think that boundary has dissolved with the advent of large models. The distribution of candidates we interview is strongly bimodal in both engineering and research experience however, and we have necessarily tailored our interview structure to that.\n", + "If you’ve an engineering background, please apply as an engineer. You’ll perform much better in the interviews, and if you join you’ll have as much input to Anthropic’s direction and interests as anyone else.\n", + "As evidence towards this: all of our papers have engineers as authors, and often as first author. Research and engineering hires all share a single title - ‘Member of Technical Staff’.\n", + "We value direct evidence of ability\n", + "If you’ve done interesting independent research, written an insightful blog post, or made substantial contributions to open-source software, put that at the top of your resume!\n", + "Feedback\n", + "We do not provide feedback on resumes or interviews.\n", + "Visas\n", + "Anthropic sponsors visas! We aren't able to sponsor them for every role and every candidate; operations roles are especially difficult to support. But if we make you an offer, we will make every effort to get you into the United States, and we retain an immigration lawyer to help with this.\n", + "Green cards\n", + "Once you’re eligible, we’re also keen to sponsor green cards!\n", + "We do not require PhDs, degrees, or previous ML experience\n", + "About half of Anthropic technical staff have a PhD of some sort; about half had prior experience in ML. We have several brilliant colleagues who never went to college.\n", + "Remote interviewing\n", + "All our interviews are conducted over Google Meet. We prefer PST office hours, but we can be flexible if that’s difficult for you.\n", + "Re-applying\n", + "Similarly, if interviews don’t work out this time, you’re welcome to re-apply after 12 months, and earlier if something materially changes about your experience or skills.\n", + "Remote work\n", + "Anthropic staff all come to the office regularly. Most staff live in the Bay Area, though a few live further away and come in for one week a month. We also understand that moving can take time, so as a transitional phase some folks start while fully remote.\n", + "Offer timing\n", + "If we make an offer, we’re happy to give you time to think about it and finish up any other interview processes you’re going through.\n", + "Internships\n", + "We do not offer internships.\n", + "Candidate Privacy Policy\n", + "US Candidate Privacy Policy\n", + "UK Employee and Candidate Privacy Policy\n", + "Claude\n", + "API\n", + "Team\n", + "Pricing\n", + "Research\n", + "Company\n", + "Customers\n", + "News\n", + "Careers\n", + "Press Inquiries\n", + "Support\n", + "Status\n", + "Availability\n", + "Twitter\n", + "LinkedIn\n", + "YouTube\n", + "Terms of Service – Consumer\n", + "Terms of Service – Commercial\n", + "Privacy Policy\n", + "Usage Policy\n", + "Responsible Disclosure Policy\n", + "Compliance\n", + "Privacy Choices\n", + "© 2024 Anthropic PBC\n", + "\n", + "\n", + "\n", + "team page\n", + "Webpage Title:\n", + "Team up with Claude \\ Anthropic\n", + "Webpage Contents:\n", + "Claude\n", + "Overview\n", + "Team\n", + "Enterprise\n", + "API\n", + "Pricing\n", + "Research\n", + "Company\n", + "Careers\n", + "News\n", + "Try Claude\n", + "Team up with Claude\n", + "Shorten the path from idea to impact with an AI assistant that taps into your team’s shared expertise.\n", + "Get started\n", + "Request demo\n", + "Easy collaboration for better outcomes\n", + "Claude doesn’t just speed up daily tasks like writing emails or docs. It’s a virtual teammate that moves work forward using your team’s knowledge.\n", + "Create with Claude\n", + "Claude can be a sounding board for your ideas, help you generate new ones, and pull insights from data in a snap.\n", + "Prime the canvas\n", + "Use Projects to ground Claude in specific knowledge that helps you produce higher-quality work with less effort.\n", + "Spark inspiration\n", + "Share your best chats with Claude across the team to spark creativity and improve your project deliverables.\n", + "Transform how you work\n", + "Claude makes work more productive—whether you need a partner for deep work, a creative collaborator, or an assistant for daily tasks.\n", + "Create with Claude\n", + "Draft and iterate on documents, code and websites, and images alongside your chat with Artifacts.\n", + "Write and debug code\n", + "Create marketing campaigns\n", + "Draft job descriptions\n", + "Build interactive visualizations\n", + "Transform how your team works\n", + "Claude can serve as your go-to expert, empowering each team member with shared knowledge from all across the organization.\n", + "Prime the canvas\n", + "Create Projects and add knowledge so each person on the team can deliver expert-level results.\n", + "Find and summarize information faster\n", + "Use Claude as your subject-matter expert\n", + "Expand how each teammate can contribute\n", + "Spark inspiration\n", + "Share your best chats with everyone on the Project to spark better ideas, iterate on Artifacts, and move work forward.\n", + "Brainstorm on new product ideas\n", + "Discuss insights from user interviews\n", + "Collaborate on hard research questions\n", + "Every team can work with Claude\n", + "Engineering\n", + "Generate code snippets in seconds\n", + "Create clear, comprehensive docs with no effort\n", + "Get help debugging even the most complex issues\n", + "Turn product feedback into roadmap items faster\n", + "Support\n", + "Resolve customer issues in record time\n", + "Craft personalized responses effortlessly\n", + "Build a dynamic, user-friendly knowledge base\n", + "Generate insightful metrics reports instantly\n", + "Marketing\n", + "Create engaging content tailored to your audience\n", + "Segment customers with pinpoint accuracy\n", + "Analyze competitors with unparalleled depth\n", + "Optimize campaigns for maximum ROI\n", + "Sales\n", + "Customize pitches for any customer segment\n", + "Uncover hidden sales trends effortlessly\n", + "Draft compelling follow-up emails in seconds\n", + "Get comprehensive competitor insights on demand\n", + "By leveraging content from our help center in Projects, we were able to generate comprehensive standard operating procedures for our core workflows in just a few hours—a task that previously took our team weeks to complete.\n", + "Bradley Silicani\n", + "COO, Anrok\n", + "Claude Team is transforming our way of working at North Highland. Claude is a truly exceptional writer that has helped our team complete content creation and analysis tasks up to 5x faster than before—turning what was once two weeks of writing and research into minutes of work.\n", + "Luka Anic\n", + "Senior Director, Technical AI Program and Product Manager, North Highland\n", + "Generating content, completing creative tasks, and creating summarized reports is much easier than before. There are many other areas of our business—like engineering, legal, risk and compliance—where we're excited to see what Claude can do.\n", + "Olga Pirog\n", + "Head of AI Transformation, IG Group\n", + "Join the teams transforming with Claude\n", + "See Pricing\n", + "Claude\n", + "API\n", + "Team\n", + "Pricing\n", + "Research\n", + "Company\n", + "Customers\n", + "News\n", + "Careers\n", + "Press Inquiries\n", + "Support\n", + "Status\n", + "Availability\n", + "Twitter\n", + "LinkedIn\n", + "YouTube\n", + "Terms of Service – Consumer\n", + "Terms of Service – Commercial\n", + "Privacy Policy\n", + "Usage Policy\n", + "Responsible Disclosure Policy\n", + "Compliance\n", + "Privacy Choices\n", + "© 2024 Anthropic PBC\n", + "\n", + "\n", + "\n", + "research page\n", + "Webpage Title:\n", + "Research \\ Anthropic\n", + "Webpage Contents:\n", + "Claude\n", + "Overview\n", + "Team\n", + "Enterprise\n", + "API\n", + "Pricing\n", + "Research\n", + "Company\n", + "Careers\n", + "News\n", + "Researching\n", + "at the frontier\n", + "At Anthropic, we develop large-scale AI systems, and our research teams help us to create safer, steerable, and more reliable models.\n", + "See open roles\n", + "Claude\n", + "API\n", + "Team\n", + "Pricing\n", + "Research\n", + "Company\n", + "Customers\n", + "News\n", + "Careers\n", + "Press Inquiries\n", + "Support\n", + "Status\n", + "Availability\n", + "Twitter\n", + "LinkedIn\n", + "YouTube\n", + "Terms of Service – Consumer\n", + "Terms of Service – Commercial\n", + "Privacy Policy\n", + "Usage Policy\n", + "Responsible Disclosure Policy\n", + "Compliance\n", + "Privacy Choices\n", + "© 2024 Anthropic PBC\n", + "\n", + "\n", + "\n", + "news page\n", + "Webpage Title:\n", + "Newsroom \\ Anthropic\n", + "Webpage Contents:\n", + "Claude\n", + "Overview\n", + "Team\n", + "Enterprise\n", + "API\n", + "Pricing\n", + "Research\n", + "Company\n", + "Careers\n", + "News\n", + "Newsroom\n", + "Featured\n", + "Powering the next generation of AI development with AWS\n", + "Press inquiries\n", + "press@anthropic.com\n", + "Non-media inquiries\n", + "support.anthropic.com\n", + "Media assets\n", + "Download press kit\n", + "Follow Anthropic\n", + "Featured\n", + "Announcing our updated Responsible Scaling Policy\n", + "Featured\n", + "Developing a computer use model\n", + "News\n", + "No results found.\n", + "Product\n", + "Tailor Claude’s responses to your personal style\n", + "Nov 26, 2024\n", + "Announcements\n", + "Introducing the Model Context Protocol\n", + "Nov 25, 2024\n", + "Announcements\n", + "Powering the next generation of AI development with AWS\n", + "Nov 22, 2024\n", + "Product\n", + "Improve your prompts in the developer console\n", + "Nov 14, 2024\n", + "Policy\n", + "The case for targeted regulation\n", + "Oct 31, 2024\n", + "Product\n", + "Raising the bar on SWE-bench Verified with Claude 3.5 Sonnet\n", + "Oct 30, 2024\n", + "Announcements\n", + "Claude 3.5 Sonnet on GitHub Copilot\n", + "Oct 29, 2024\n", + "Product\n", + "Introducing the analysis tool in Claude.ai\n", + "Oct 24, 2024\n", + "Announcements\n", + "·\n", + "Product\n", + "Developing a computer use model\n", + "Oct 22, 2024\n", + "Announcements\n", + "Introducing computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku\n", + "Oct 22, 2024\n", + "Announcements\n", + "Announcing our updated Responsible Scaling Policy\n", + "Oct 15, 2024\n", + "Societal Impacts\n", + "U.S. Elections Readiness\n", + "Oct 8, 2024\n", + "Product\n", + "Introducing the Message Batches API\n", + "Oct 8, 2024\n", + "Product\n", + "·\n", + "Announcements\n", + "Introducing Contextual Retrieval\n", + "Sep 19, 2024\n", + "Product\n", + "Workspaces in the Anthropic API Console\n", + "Sep 10, 2024\n", + "Product\n", + "Claude for Enterprise\n", + "Sep 4, 2024\n", + "Announcements\n", + "Salesforce teams up with Anthropic to enhance Einstein capabilities with Claude\n", + "Sep 3, 2024\n", + "Announcements\n", + "Artifacts are now generally available\n", + "Aug 27, 2024\n", + "Product\n", + "Prompt caching with Claude\n", + "Aug 14, 2024\n", + "Announcements\n", + "Expanding our model safety bug bounty program\n", + "Aug 8, 2024\n", + "Announcements\n", + "Claude is now available in Brazil\n", + "Aug 1, 2024\n", + "Announcements\n", + "Anthropic partners with Menlo Ventures to launch Anthology Fund\n", + "Jul 17, 2024\n", + "Product\n", + "Claude Android app\n", + "Jul 16, 2024\n", + "Product\n", + "Fine-tune Claude 3 Haiku in Amazon Bedrock\n", + "Jul 11, 2024\n", + "Product\n", + "Evaluate prompts in the developer console\n", + "Jul 9, 2024\n", + "Announcements\n", + "A new initiative for developing third-party model evaluations\n", + "Jul 1, 2024\n", + "Announcements\n", + "Expanding access to Claude for government\n", + "Jun 26, 2024\n", + "Product\n", + "Collaborate with Claude on Projects\n", + "Jun 25, 2024\n", + "Announcements\n", + "Claude 3.5 Sonnet\n", + "Jun 21, 2024\n", + "Policy\n", + "Challenges in red teaming AI systems\n", + "Jun 12, 2024\n", + "Policy\n", + "·\n", + "Societal Impacts\n", + "Testing and mitigating elections-related risks\n", + "Jun 6, 2024\n", + "Announcements\n", + "Introducing Claude to Canada\n", + "Jun 5, 2024\n", + "Product\n", + "Claude can now use tools\n", + "May 30, 2024\n", + "Announcements\n", + "Jay Kreps appointed to Anthropic's Board of Directors\n", + "May 29, 2024\n", + "Product\n", + "Golden Gate Claude\n", + "May 23, 2024\n", + "Announcements\n", + "Krishna Rao joins Anthropic as Chief Financial Officer\n", + "May 21, 2024\n", + "Interpretability\n", + "Mapping the Mind of a Large Language Model\n", + "May 21, 2024\n", + "Product\n", + "Generate better prompts in the developer console\n", + "May 20, 2024\n", + "Policy\n", + "Reflections on our Responsible Scaling Policy\n", + "May 20, 2024\n", + "Announcements\n", + "Mike Krieger joins Anthropic as Chief Product Officer\n", + "May 15, 2024\n", + "Announcements\n", + "Claude is now available in Europe\n", + "May 14, 2024\n", + "Announcements\n", + "Updating our Usage Policy\n", + "May 10, 2024\n", + "Product\n", + "·\n", + "Announcements\n", + "Introducing the Claude Team plan and iOS app\n", + "May 1, 2024\n", + "Announcements\n", + "Aligning on child safety principles\n", + "Apr 23, 2024\n", + "Alignment\n", + "Many-shot jailbreaking\n", + "Apr 2, 2024\n", + "Policy\n", + "Third-party testing as a key ingredient of AI policy\n", + "Mar 25, 2024\n", + "Announcements\n", + "Anthropic, AWS, and Accenture team up to build trusted solutions for enterprises\n", + "Mar 20, 2024\n", + "Announcements\n", + "Claude 3 models on Vertex AI\n", + "Mar 19, 2024\n", + "Announcements\n", + "Claude 3 Haiku: our fastest model yet\n", + "Mar 13, 2024\n", + "Announcements\n", + "Introducing the next generation of Claude\n", + "Mar 4, 2024\n", + "Product\n", + "Prompt engineering for business performance\n", + "Feb 29, 2024\n", + "Policy\n", + "Preparing for global elections in 2024\n", + "Feb 16, 2024\n", + "Announcements\n", + "Expanded legal protections and improvements to our API\n", + "Dec 19, 2023\n", + "Product\n", + "Long context prompting for Claude 2.1\n", + "Dec 6, 2023\n", + "Product\n", + "Introducing Claude 2.1\n", + "Nov 21, 2023\n", + "Policy\n", + "Thoughts on the US Executive Order, G7 Code of Conduct, and Bletchley Park Summit\n", + "Nov 5, 2023\n", + "Policy\n", + "Dario Amodei’s prepared remarks from the AI Safety Summit on Anthropic’s Responsible Scaling Policy\n", + "Nov 1, 2023\n", + "Announcements\n", + "Claude on Amazon Bedrock now available to every AWS customer\n", + "Sep 28, 2023\n", + "Announcements\n", + "Expanding access to safer AI with Amazon\n", + "Sep 25, 2023\n", + "Product\n", + "Prompt engineering for Claude's long context window\n", + "Sep 23, 2023\n", + "Announcements\n", + "Anthropic's Responsible Scaling Policy\n", + "Sep 19, 2023\n", + "Announcements\n", + "The Long-Term Benefit Trust\n", + "Sep 19, 2023\n", + "Announcements\n", + "Anthropic partners with BCG\n", + "Sep 14, 2023\n", + "Announcements\n", + "Introducing Claude Pro\n", + "Sep 7, 2023\n", + "Product\n", + "Claude 2 on Amazon Bedrock\n", + "Aug 23, 2023\n", + "Announcements\n", + "SKT Partnership Announcement\n", + "Aug 15, 2023\n", + "Announcements\n", + "Releasing Claude Instant 1.2\n", + "Aug 9, 2023\n", + "Announcements\n", + "Frontier Threats Red Teaming for AI Safety\n", + "Jul 26, 2023\n", + "Announcements\n", + "Frontier Model Security\n", + "Jul 25, 2023\n", + "Announcements\n", + "Claude 2\n", + "Jul 11, 2023\n", + "Announcements\n", + "Charting a Path to AI Accountability\n", + "Jun 13, 2023\n", + "Announcements\n", + "Anthropic Raises $450 Million in Series C Funding to Scale Reliable AI Products\n", + "May 23, 2023\n", + "Announcements\n", + "Zoom Partnership and Investment in Anthropic\n", + "May 16, 2023\n", + "Announcements\n", + "Introducing 100K Context Windows\n", + "May 11, 2023\n", + "Announcements\n", + "Claude’s Constitution\n", + "May 9, 2023\n", + "Announcements\n", + "Partnering with Scale to Bring Generative AI to Enterprises\n", + "Apr 26, 2023\n", + "Announcements\n", + "An AI Policy Tool for Today: Ambitiously Invest in NIST\n", + "Apr 20, 2023\n", + "Announcements\n", + "Claude, now in Slack\n", + "Mar 30, 2023\n", + "Announcements\n", + "Introducing Claude\n", + "Mar 14, 2023\n", + "Announcements\n", + "Core Views on AI Safety: When, Why, What, and How\n", + "Mar 8, 2023\n", + "Announcements\n", + "Anthropic Partners with Google Cloud\n", + "Feb 3, 2023\n", + "Announcements\n", + "Anthropic Raises Series B to Build Steerable, Interpretable, Robust AI Systems\n", + "Apr 29, 2022\n", + "Announcements\n", + "Anthropic raises $124 million to build more reliable, general AI systems\n", + "May 28, 2021\n", + "Claude\n", + "API\n", + "Team\n", + "Pricing\n", + "Research\n", + "Company\n", + "Customers\n", + "News\n", + "Careers\n", + "Press Inquiries\n", + "Support\n", + "Status\n", + "Availability\n", + "Twitter\n", + "LinkedIn\n", + "YouTube\n", + "Terms of Service – Consumer\n", + "Terms of Service – Commercial\n", + "Privacy Policy\n", + "Usage Policy\n", + "Responsible Disclosure Policy\n", + "Compliance\n", + "Privacy Choices\n", + "© 2024 Anthropic PBC\n", + "\n", + "\n" + ] + } + ], "source": [ "print(get_all_details(\"https://anthropic.com\"))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "9b863a55-f86c-4e3f-8a79-94e24c1a8cf2", "metadata": {}, "outputs": [], @@ -278,7 +1191,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "6ab83d92-d36b-4ce0-8bcc-5bb4c2f8ff23", "metadata": {}, "outputs": [], @@ -293,17 +1206,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "cd909e0b-1312-4ce2-a553-821e795d7572", - "metadata": {}, - "outputs": [], + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://www.anthropic.com/company'}, {'type': 'careers page', 'url': 'https://www.anthropic.com/careers'}, {'type': 'team page', 'url': 'https://www.anthropic.com/team'}, {'type': 'research page', 'url': 'https://www.anthropic.com/research'}, {'type': 'enterprise page', 'url': 'https://www.anthropic.com/enterprise'}, {'type': 'api page', 'url': 'https://www.anthropic.com/api'}, {'type': 'pricing page', 'url': 'https://www.anthropic.com/pricing'}, {'type': 'news page', 'url': 'https://www.anthropic.com/news'}]}\n" + ] + }, + { + "data": { + "text/plain": [ + "\"You are looking at a company called: Anthropic\\nHere are the contents of its landing page and other relevant pages; use this information to build a short brochure of the company in markdown.\\nLanding page:\\nWebpage Title:\\nHome \\\\ Anthropic\\nWebpage Contents:\\nClaude\\nOverview\\nTeam\\nEnterprise\\nAPI\\nPricing\\nResearch\\nCompany\\nCareers\\nNews\\nAI\\nresearch\\nand\\nproducts\\nthat put safety at the frontier\\nClaude.ai\\nMeet Claude 3.5 Sonnet\\nClaude 3.5 Sonnet, our most intelligent AI model, is now available.\\nTalk to Claude\\nAPI\\nBuild with Claude\\nStart using Claude to drive efficiency and create new revenue streams.\\nLearn more\\nAnnouncements\\nIntroducing computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku\\nOct 22, 2024\\nModel updates\\n3.5 Sonnet\\n3.5 Haiku\\nOur Work\\nProduct\\nClaude for Enterprise\\nSep 4, 2024\\nAlignment\\n·\\nResearch\\nConstitutional AI: Harmlessness from AI Feedback\\nDec 15, 2022\\nAnnouncements\\nCore Views on AI Safety: When, Why, What, and How\\nMar 8, 2023\\nWork with Anthropic\\nAnthropic is an AI safety and research company based in San Francisco. Our interdisciplinary team has experience across ML, physics, policy, and product. Together, we generate research and create reliable, beneficial AI systems.\\nSee open roles\\nClaude\\nAPI\\nTeam\\nPricing\\nResearch\\nCompany\\nCustomers\\nNews\\nCareers\\nPress Inquiries\\nSupport\\nStatus\\nAvailability\\nTwitter\\nLinkedIn\\nYouTube\\nTerms of Service – Consumer\\nTerms of Service – Commercial\\nPrivacy Policy\\nUsage Policy\\nResponsible Disclosure Policy\\nCompliance\\nPrivacy Choices\\n© 2024 Anthropic PBC\\n\\n\\n\\nabout page\\nWebpage Title:\\nCompany \\\\ Anthropic\\nWebpage Contents:\\nClaude\\nOverview\\nTeam\\nEnterprise\\nAPI\\nPricing\\nResearch\\nCompany\\nCareers\\nNews\\nMaking AI systems\\nyou can rely on\\nAnthropic is an AI safety and research company. We build reliable, interpretable, and steerable AI systems.\\nJoin us\\nOur Purpose\\nWe believe AI will have a vast impact on the world. Anthropic is dedicated to building systems that people can rely on and generating research about the opportunities and risks of AI.\\nWe Build Safer Systems\\nWe aim to build frontier AI systems that are reliable, interpretable, and steerable. We conduct frontier research, develop and apply a variety of safety techniques, and deploy the resulting systems via a set of partnerships and products.\\nSafety Is a Science\\nWe treat AI safety as a systematic science, conducting research, applying it to our products, feeding those insights back into our research, and regularly sharing what we learn with the world along the way.\\nInterdisciplinary\\nAnthropic is a collaborative team of researchers, engineers, policy experts, business leaders and operators, who bring our experience from many different domains to our work.\\nAI Companies are One Piece of a Big Puzzle\\nAI has the potential to fundamentally change how the world works. We view ourselves as just one piece of this evolving puzzle. We collaborate with civil society, government, academia, nonprofits and industry to promote safety industry-wide.\\nThe Team\\nWe’re a team of researchers, engineers, policy experts and operational leaders, with experience spanning a variety of disciplines, all working together to build reliable and understandable AI systems.\\nResearch\\nWe conduct frontier AI research across a variety of modalities, and explore novel and emerging safety research areas from interpretability to RL from human feedback to policy and societal impacts analysis.\\nPolicy\\nWe think about the impacts of our work and strive to communicate what we’re seeing at the frontier to policymakers and civil society in the US and abroad to help promote safe and reliable AI.\\nProduct\\nWe translate our research into tangible, practical tools like Claude that benefit businesses, nonprofits and civil society groups and their clients and people around the globe.\\nOperations\\nOur people, finance, legal, and recruiting teams are the human engines that make Anthropic go. We’ve had previous careers at NASA, startups, and the armed forces and our diverse experiences help make Anthropic a great place to work (and we love plants!).\\nOur Values\\n01\\nHere for the mission\\nAnthropic exists for our mission: to ensure transformative AI helps people and society flourish. Progress this decade may be rapid, and we expect increasingly capable systems to pose novel challenges. We pursue our mission by building frontier systems, studying their behaviors, working to responsibly deploy them, and regularly sharing our safety insights. We collaborate with other projects and stakeholders seeking a similar outcome.\\n02\\nUnusually high trust\\nOur company is an unusually high trust environment: we assume good faith, disagree kindly, and prioritize honesty. We expect emotional maturity and intellectual openness. At its best, our trust enables us to make better decisions as an organization than any one of us could as individuals.\\n03\\nOne big team\\nCollaboration is central to our work, culture, and value proposition. While we have many teams at Anthropic, we feel the broader sense in which we are all on the same team working together towards the mission. Leadership sets the strategy, with broad input from everyone, and trusts each piece of the organization to pursue these goals in their unique style. Individuals commonly contribute to work across many different areas.\\n04\\nDo the simple thing that works\\nWe celebrate trying the simple thing before the clever, novel thing. We embrace pragmatism - sensible, practical approaches that acknowledge tradeoffs. We love empiricism - finding out what actually works by trying it - and apply this to our research, our engineering and our collaboration. We aim to be open about what we understand and what we don’t.\\nGovernance\\nAnthropic is a Public Benefit Corporation, whose purpose is the responsible development and maintenance of advanced AI for the long-term benefit of humanity. Our Board of Directors is elected by stockholders and our Long-Term Benefit Trust, as explained\\nhere.\\nCurrent members of the Board and the Long-Term Benefit Trust (LTBT) are listed below.\\nAnthropic Board of Directors\\nDario Amodei, Daniela Amodei, Yasmin Razavi, and Jay Kreps.\\nLTBT Trustees\\nNeil Buddy Shah, Kanika Bahl, and Zach Robinson.\\nCompany News\\nSee All\\nAnnouncements\\nIntroducing the Model Context Protocol\\nNov 25, 2024\\nAnnouncements\\nPowering the next generation of AI development with AWS\\nNov 22, 2024\\nAnnouncements\\nClaude 3.5 Sonnet on GitHub Copilot\\nOct 29, 2024\\nWant to help us build the future of safe AI?\\nJoin us\\nClaude\\nAPI\\nTeam\\nPricing\\nResearch\\nCompany\\nCustomers\\nNews\\nCareers\\nPress Inquiries\\nSupport\\nStatus\\nAvailability\\nTwitter\\nLinkedIn\\nYouTube\\nTerms of Service – Consumer\\nTerms of Service – Commercial\\nPrivacy Policy\\nUsage Policy\\nResponsible Disclosure Policy\\nCompliance\\nPrivacy Choices\\n© 2024 Anthropic PBC\\n\\n\\n\\ncareers page\\nWebpage Title:\\nCareers \\\\ Anthropic\\nWebpage Contents:\\nClaude\\nOverview\\nTeam\\nEnterprise\\nAPI\\nPricing\\nResearch\\nCompany\\nCareers\\nNews\\nJoin the team\\nmaking AI safe\\nWe’re a public benefit corporation headquartered in San Francisco. Our team’s experience spans a variety of backgrounds and disciplines, from physics and machine learning to public policy and business. We work as a cohesive team that collectively forecasts the impact and tractability of research ideas in advancing our mission.\\nSee open roles\\nWhat We Offer\\nHealth & Wellness\\nAt Anthropic, we believe that supporting our employees is crucial to our collective success and wellbeing. That's why we offer a range of benefits to best support you and your family, now and in the future.\\nComprehensive health, dental, and vision insurance for you and your dependents\\nInclusive fertility benefits via Carrot Fertility\\n22 weeks of paid parental leave\\nFlexible paid time off and absence policies\\nGenerous mental health support for you and your dependents\\nCompensation & Support\\nOur goal is to foster an environment where you can thrive professionally while feeling confident that you and your loved ones are taken care of.\\nCompetitive salary and equity packages\\nOptional equity donation matching at a 1:1 ratio, up to 25% of your equity grant\\nRobust retirement plans and salary sacrifice programs with market competitive matching\\nLife and income protection plans\\nAdditional Benefits\\n$500/month flexible wellness and time saver stipend\\nCommuter benefits\\nAnnual education stipend\\nHome office stipends\\nRelocation support for those moving for Anthropic\\nDaily meals and snacks in the office\\nHow We Hire\\nThe interview process at Anthropic varies based on role and candidate, but our standard process looks like this:\\nStep 1\\nResume\\nSubmit your resume via our website.\\nStep 2\\nExploratory chat\\nYou’ll have a chat with one of our staff to discuss your career interests and relevant experience, and learn more about Anthropic.\\nStep 3\\nSkills Assessment\\nFor technical roles, you’ll have a one-hour technical screening interview.\\nFor operations or policy roles, you’ll get a take-home assignment. These typically involve writing responses to several role-relevant questions; they may occasionally require some outside research. Assignments usually take between 2-5 hours, depending on the role.\\nWe include this to minimize bias and make well-informed hiring decisions. We think seeing a candidate’s work helps us assess how they might actually perform on the job; similarly, the assignment gives candidates a better idea of what their work at Anthropic might entail. If a candidate likes working through their take-home, that is one indicator that they would enjoy taking on the role, and vice versa.\\nWe recognize that completing work assignments requires time and effort, and that they are not perfectly reflective of the role’s work. Nonetheless, we think that work tests are a useful complement to interviews and reference checks.\\nStep 4\\nTeam Screen\\nYou'll have a conversation with either the Hiring Manager or a member of your potential team.\\nStep 5\\nInterview Panel\\nFor technical roles, you’ll have 3-4 more one-hour technical interviews, plus a culture interview.\\nFor operations or policy roles, you’ll have 3-5 hours of interviews, including a culture interview.\\nStep 6\\nFinal Checks\\nWe’ll ask for some references, and have you chat with our leadership.\\nStep 7\\nOffer\\nWe’ll make you an offer!\\nTechnical Interviews\\nThe novel challenges we think about at Anthropic demand diverse expertise and perspectives. Our interview process is designed to identify thoughtful candidates who bring unique strengths to our multidisciplinary team. If you think this may describe you, we’d love to hear from you regardless of your background or experience.\\nOne of the most common questions we get is about whether it is worth applying to work at Anthropic if you have not worked on modern machine learning systems in the past. Yes! For some roles, ML experience is expected, but many technical staff have arrived at Anthropic with no machine learning experience. If you aren’t sure about the ML experience needed for your role, ask your recruiter.\\nWe use shared environments like Colab and Replit for our programming-focused interviews. We’ll be very interested in how you think through each problem and analyze the tradeoffs between possible approaches, and we’ll also expect you to write, run, and debug your solutions. You’ll be allowed to look things up in documentation or on the web, just like you usually can (which is why we’ll ask you to share your screen throughout each interview); but it’s still important to be familiar with basic syntax, standard libraries, and common idioms in the language you’re interviewing in, so that looking things up doesn’t consume too much time. Your interview process will also include non-technical questions about your experience and what motivates you, and, of course, you’ll have time to ask us about Anthropic! We can’t wait to meet you.\\nOther Things\\nEngineers here do lots of research, and researchers do lots of engineering\\nWhile there’s historically been a division between engineering and research in machine learning, we think that boundary has dissolved with the advent of large models. The distribution of candidates we interview is strongly bimodal in both engineering and research experience however, and we have necessarily tailored our interview structure to that.\\nIf you’ve an engineering background, please apply as an engineer. You’ll perform much better in the interviews, and if you join you’ll have as much input to Anthropic’s direction and interests as anyone else.\\nAs evidence towards this: all of our papers have engineers as authors, and often as first author. Research and engineering hires all share a single title - ‘Member of Technical Staff’.\\nWe value direct evidence of ability\\nIf you’ve done interesting independent research, written an insightful blog post, or made substantial contributions to open-source software, put that at the top of your resume!\\nFeedback\\nWe do not provide feedback on resumes or interviews.\\nVisas\\nAnthropic sponsors visas! We aren't able to sponsor them for every role and every candidate; operations roles are especially difficult to support. But if we make you an offer, we will make every effort to get you into the United States, and we retain an immigration lawyer to help with this.\\nGreen cards\\nOnce you’re eligible, we’re also keen to sponsor green cards!\\nWe do not require PhDs, degrees, or previous ML experience\\nAbout half of Anthropic technical staff have a PhD of some sort; about half had prior experience in ML. We have several brilliant colleagues who never went to college.\\nRemote interviewing\\nAll our interviews are conducted over Google Meet. We prefer PST office hours, but we can be flexible if that’s difficult for you.\\nRe-applying\\nSimilarly, if interviews don’t work out this time, you’re welcome to re-apply after 12 months, and earlier if something materially changes about your experience or skills.\\nRemote work\\nAnthropic staff all come to the office regularly. Most staff live in the Bay Area, though a few live further away and come in for one week a month. We also understand that moving can take time, so as a transitional phase some folks start while fully remote.\\nOffer timing\\nIf we make an offer, we’re happy to give you time to think about it and finish up any other interview processes you’re going through.\\nInternships\\nWe do not offer internships.\\nCandidate Privacy Policy\\nUS Candidate Privacy Policy\\nUK Employee and Candidate Privacy Policy\\nClaude\\nAPI\\nTeam\\nPricing\\nResearch\\nCompany\\nCustomers\\nNews\\nCareers\\nPress Inquiries\\nSupport\\nStatus\\nAvailability\\nTwitter\\nLinkedIn\\nYouTube\\nTerms of Service – Consumer\\nTerms of Service – Commercial\\nPrivacy Policy\\nUsage Policy\\nResponsible Disclosure Policy\\nCompliance\\nPrivacy Choices\\n© 2024 Anthropic PBC\\n\\n\\n\\nteam page\\nWebpage Title:\\nTeam up with Claude \\\\ Anthropic\\nWebpage Contents:\\nClaude\\nOverview\\nTeam\\nEnterprise\\nAPI\\nPricing\\nResearch\\nCompany\\nCareers\\nNews\\nTry Claude\\nTeam up with Claude\\nShorten the path from idea to impact with an AI assistant that taps into your team’s shared expertise.\\nGet started\\nRequest demo\\nEasy collaboration for better outcomes\\nClaude doesn’t just speed up daily tasks like writing emails or docs. It’s a virtual teammate that moves work forward using your team’s knowledge.\\nCreate with Claude\\nClaude can be a sounding board for your ideas, help you generate new ones, and pull insights from data in a snap.\\nPrime the canvas\\nUse Projects to ground Claude in specific knowledge that helps you produce higher-quality work with less effort.\\nSpark inspiration\\nShare your best chats with Claude across the team to spark creativity and improve your project deliverables.\\nTransform how you work\\nClaude makes work more productive—whether you need a partner for deep work, a creative collaborator, or an assistant for daily tasks.\\nCreate with Claude\\nDraft and iterate on documents, code and websites, and images alongside your chat with Artifacts.\\nWrite and debug code\\nCreate marketing campaigns\\nDraft job descriptions\\nBuild interactive visualizations\\nTransform how your team works\\nClaude can serve as your go-to expert, empowering each team member with shared knowledge from all across the organization.\\nPrime the canvas\\nCreate Projects and add knowledge so each person on the team can deliver expert-level results.\\nFind and summarize information faster\\nUse Claude as your subject-matter expert\\nExpand how each teammate can contribute\\nSpark inspiration\\nShare your best chats with everyone on the Project to spark better ideas, iterate on Artifacts, and move work forward.\\nBrainstorm on new product ideas\\nDiscuss insights from user interviews\\nCollaborate on hard research questions\\nEvery team can work with Claude\\nEngineering\\nGenerate code snippets in seconds\\nCreate clear, comprehensive docs with no effort\\nGet help debugging even the most complex issues\\nTurn product feedback into roadmap items faster\\nSupport\\nResolve customer issues in record time\\nCraft personalized responses effortlessly\\nBuild a dynamic, user-friendly knowledge base\\nGenerate insightful metrics reports instantly\\nMarketing\\nCreate engaging content tailored to your audience\\nSegment customers with pinpoint accuracy\\nAnalyze competitors with unparalleled depth\\nOptimize campaigns for maximum ROI\\nSales\\nCustomize pitches for any customer segment\\nUncover hidden sales trends effortlessly\\nDraft compelling follow-up emails in seconds\\nGet comprehensive competitor insights on demand\\nBy leveraging content from our help center in Projects, we were able to generate comprehensive standard operating procedures for our core workflows in just a few hours—a task that previously took our team weeks to complete.\\nBradley Silicani\\nCOO, Anrok\\nClaude Team is transforming our way of working at North Highland. Claude is a truly exceptional writer that has helped our team complete content creation and analysis tasks up to 5x faster than before—turning what was once two weeks of writing and research into minutes of work.\\nLuka Anic\\nSenior Director, Technical AI Program and Product Manager, North Highland\\nGenerating content, completing creative tasks, and creating summarized reports is much easier than before. There are many other areas of our business—like engineering, legal, risk and compliance—where we're excited to see what Claude can do.\\nOlga Pirog\\nHead of AI Transformation, IG Group\\nJoin the teams transforming with Claude\\nSee Pricing\\nClaude\\nAPI\\nTeam\\nPricing\\nResearch\\nCompany\\nCustomers\\nNews\\nCareers\\nPress Inquiries\\nSupport\\nStatus\\nAvailability\\nTwitter\\nLinkedIn\\nYouTube\\nTerms of Service – Consumer\\nTerms of Service – Commercial\\nPrivacy Policy\\nUsage Policy\\nResponsible Disclosure Policy\\nCompliance\\nPrivacy Choices\\n© 2024 Anthropic PBC\\n\\n\\n\\nresearch page\\nWebpage Title:\\nResearch \\\\ Anthropic\\nWebpage Contents:\\nClaude\\nOverview\\nTeam\\nEnterprise\\nAPI\\nPricing\\nResearch\\nCompany\\nCareers\\nNews\\nResearching\\nat the frontier\\nAt Anthropic, we develop large-scale AI systems, and our research teams help us to create safer, steerable, and more reliable models.\\nSee open roles\\nClaude\\nAPI\\nTeam\\nPricing\\nResearch\\nCompany\\nCustomers\\nNews\\nCareers\\nPress Inquiries\\nSupport\\nStatus\\nAvailability\\nTwitter\\nLinkedIn\\nYouTube\\nTerms of Service – Consumer\\nTerms of Service – Commercial\\nPrivacy Policy\\nUsage Policy\\nResponsible Disclosure Policy\\nCompliance\\nPrivacy Choices\\n© 2024 Anthropic PBC\\n\\n\\n\\nenterprise page\\nWebpage Title:\\nEnterprise \\\\ Anthropic\\nWebpage Contents:\\nClaude\\nOverview\\nTeam\\nEnterprise\\nAPI\\nPricing\\nResearch\\nCompany\\nCareers\\nNews\\nClaude for\\n Enterprise\\nSecurely connect Claude to your company knowledge and empower every team with trusted AI.\\nContact sales\\nEmpower your entire organization with AI\\nEnable every team to spark new ideas, achieve more, and collaborate better.\\nUse company knowledge\\nScale internal expertise and knowledge across projects and teams.\\nCreate and share work\\nProduce high-impact output more efficiently with Claude.\\nSecure your data\\nProtect your sensitive data. Anthropic does not train our models on your Claude for Work data.\\nUse company knowledge\\nBring internal knowledge to scale institutional expertise, collaboration and decision-making across your enterpris\"" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "get_brochure_user_prompt(\"Anthropic\", \"https://anthropic.com\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "id": "e44de579-4a1a-4e6a-a510-20ea3e4b8d46", "metadata": {}, "outputs": [], @@ -322,10 +1255,85 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "id": "e093444a-9407-42ae-924a-145730591a39", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://anthropic.com/company'}, {'type': 'careers page', 'url': 'https://anthropic.com/careers'}, {'type': 'team page', 'url': 'https://anthropic.com/team'}, {'type': 'research page', 'url': 'https://anthropic.com/research'}, {'type': 'pricing page', 'url': 'https://anthropic.com/pricing'}, {'type': 'enterprise page', 'url': 'https://anthropic.com/enterprise'}, {'type': 'api page', 'url': 'https://anthropic.com/api'}, {'type': 'news page', 'url': 'https://anthropic.com/news'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "# Anthropic Company Brochure\n", + "\n", + "## Overview\n", + "Anthropic is a pioneering AI safety and research organization based in San Francisco, committed to developing reliable, interpretable, and steerable AI systems. With a strong focus on safety as a scientific discipline, Anthropic aims to generate insights on the opportunities and risks associated with AI developments. The company promotes collaboration with civil society, government, academia, and industry to foster a safer AI ecosystem for the world.\n", + "\n", + "## Our Purpose\n", + "At Anthropic, we believe that AI will have a significant impact on the world. Our mission is to ensure that transformative AI benefits society and individuals alike. Our interdisciplinary team of researchers, engineers, policy experts, and operational leaders works collaboratively to tackle the challenges posed by advanced AI technologies.\n", + "\n", + "## Products\n", + "### Claude\n", + "**Claude 3.5 Sonnet**: Our most advanced AI model designed to assist businesses in driving efficiency and creating new revenue streams. Claude serves as a virtual teammate, enhancing productivity through automation and intelligent collaboration.\n", + "\n", + "### Enterprise Solutions\n", + "Anthropic provides enterprise-level solutions that seamlessly connect Claude to organizational knowledge, empowering teams to harness the full potential of AI in their workflows. Our offerings include tailored integrations that foster innovation and improve operational efficiencies across various functions like Engineering, Marketing, Sales, and Customer Support.\n", + "\n", + "## Customers\n", + "Our diverse clientele consists of businesses, nonprofits, and civil society organizations that leverage Claude's capabilities to enhance their operations, creative processes, and overall productivity. Customers have reported significant improvements in efficiency, such as achieving project outcomes in markedly reduced timeframes.\n", + "\n", + "## Team and Culture\n", + "At Anthropic, we uphold a culture of unusually high trust, emotional maturity, and intellectual openness. We operate as one cohesive team, valuing collaboration across disciplines to enrich our work. Our values reflect our commitment to our mission and our drive to ensure that our systems help society flourish.\n", + "\n", + "### Company Values\n", + "1. **Here for the Mission**: We are dedicated to building AI systems that prioritize safety and human benefit.\n", + "2. **Unusually High Trust**: Our work environment fosters honesty and constructive disagreement.\n", + "3. **One Big Team**: Collaboration is central; input from all levels shapes our organizational goals.\n", + "4. **Do the Simple Thing That Works**: We embrace pragmatic, evidence-based approaches in our processes.\n", + "\n", + "## Careers at Anthropic\n", + "Join us in our mission to make AI safe for the future. At Anthropic, we pride ourselves on hiring individuals from diverse backgrounds, ensuring a rich variety of perspectives in our team.\n", + "\n", + "### What We Offer\n", + "- **Health & Wellness**: Comprehensive health benefits, inclusive fertility support, flexible paid time off, and generous mental health resources.\n", + "- **Compensation & Support**: Competitive salaries, equity packages, robust retirement plans, and additional perks like a wellness stipend and daily meals in our office.\n", + "- **Career Growth**: Opportunities to work on cutting-edge research and contribute to impactful AI technology, alongside a supportive and collaborative work environment.\n", + "\n", + "### How to Apply\n", + "Our interview process is designed to minimize bias and highlight each candidate's strengths. It includes:\n", + "1. **Resume Submission**\n", + "2. **Exploratory Chat**\n", + "3. **Skills Assessment**\n", + "4. **Team Screening**\n", + "5. **Interview Panel**\n", + "6. **Final Checks and Offer**\n", + "\n", + "We welcome talented individuals passionate about AI safety and innovation. Explore our open roles on our [Careers Page](https://www.anthropic.com/careers).\n", + "\n", + "## Join Us\n", + "If you're eager to contribute to AI's future and want to explore innovative ways to ensure its safe development, we invite you to connect with us. Together, let's build AI that people can rely on.\n", + "\n", + "**Website**: [Anthropic](https://www.anthropic.com)\n", + "\n", + "**Social Media**: Follow us on [LinkedIn](https://www.linkedin.com/company/anthropic) and [Twitter](https://twitter.com/AnthropicAI) for the latest updates.\n", + "\n", + "--- \n", + "\n", + "This brochure encapsulates Anthropic's mission, culture, product offerings, and career opportunities. We look forward to welcoming you to our team and the future of AI!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "create_brochure(\"Anthropic\", \"https://anthropic.com\")" ] @@ -343,7 +1351,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "id": "51db0e49-f261-4137-aabe-92dd601f7725", "metadata": {}, "outputs": [], @@ -368,20 +1376,170 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "id": "56bf0ae3-ee9d-4a72-9cd6-edcac67ceb6d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://www.anthropic.com/company'}, {'type': 'careers page', 'url': 'https://www.anthropic.com/careers'}, {'type': 'team page', 'url': 'https://www.anthropic.com/team'}, {'type': 'research page', 'url': 'https://www.anthropic.com/research'}, {'type': 'news page', 'url': 'https://www.anthropic.com/news'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "# Anthropic Brochure\n", + "\n", + "---\n", + "\n", + "## About Us\n", + "\n", + "**Anthropic** is an AI safety and research company headquartered in San Francisco, dedicated to developing reliable, interpretable, and steerable AI systems. With the belief that AI will have a vast impact on the world, we focus on building systems that people can trust while generating research about the opportunities and risks of AI. Our mission is to ensure that transformative AI helps people and society flourish.\n", + "\n", + "---\n", + "\n", + "## Our Products\n", + "\n", + "### Claude\n", + "Claude is our flagship AI assistant, designed to empower teams by enhancing productivity and collaboration. Users can utilize Claude for tasks such as:\n", + "\n", + "- Drafting and iterating documents\n", + "- Writing and debugging code\n", + "- Creating marketing content\n", + "- Generating insightful reports\n", + "\n", + "Claude is equipped to assist across various functions within organizations, ensuring that every team member has access to shared knowledge and expertise.\n", + "\n", + "### API\n", + "Our API enables businesses to integrate Claude’s capabilities into their existing systems, driving efficiency and creating new revenue streams.\n", + "\n", + "---\n", + "\n", + "## Company Culture\n", + "\n", + "At Anthropic, we emphasize a culture of **collaboration**, **trust**, and **intellectual openness**. Our values include:\n", + "\n", + "1. **Here for the Mission**: Focused on ensuring that AI systems are safe and beneficial for society.\n", + "2. **Unusually High Trust**: We prioritize honesty and the assumption of good faith in all interactions.\n", + "3. **One Big Team**: Promoting collaboration across all teams, recognizing that every member contributes to the organization's shared goals.\n", + "4. **Pragmatic Approach**: We celebrate simplistic solutions to problems and rely on empirical evidence to guide our practices.\n", + "\n", + "---\n", + "\n", + "## Our Team\n", + "\n", + "Anthropic's diverse team consists of researchers, engineers, policy experts, and operational leaders, all bringing different expertise to our mission. We foster an interdisciplinary approach, combining knowledge from various domains such as machine learning, physics, and public policy. Our leadership encourages input from all levels, ensuring that every voice contributes to the company’s strategic direction.\n", + "\n", + "---\n", + "\n", + "## Careers at Anthropic\n", + "\n", + "We are always on the lookout for talented individuals who are passionate about AI safety and innovation. Our hiring process is designed to identify thoughtful candidates from varied backgrounds, with a commitment to reduce biases. \n", + "\n", + "### What We Offer\n", + "- **Health & Wellness**: Comprehensive healthcare, flexible paid time off, and generous mental health support.\n", + "- **Competitive Compensation**: Attractive salary, equity packages, and additional benefits like stipends for wellness and education.\n", + "- **Growth Opportunities**: As a public benefit corporation, we're invested in the long-term benefits of our employees and the communities we serve.\n", + "\n", + "### Join Us\n", + "Check our [Careers page](https://anthropic.com/careers) for open roles and more information on how to apply.\n", + "\n", + "---\n", + "\n", + "## Customers\n", + "\n", + "Our products benefit businesses, nonprofits, and civil society organizations globally. Customer success stories highlight tangible improvements in productivity and efficiency, thanks to Claude’s capabilities. \n", + "\n", + "---\n", + "\n", + "## Follow Along\n", + "\n", + "Stay updated on our latest innovations and developments by following us on social media:\n", + "\n", + "- [Twitter](https://twitter.com/anthropic)\n", + "- [LinkedIn](https://linkedin.com/company/anthropic)\n", + "- [YouTube](https://youtube.com/@anthropic)\n", + "\n", + "---\n", + "\n", + "For more information, please visit our website at [Anthropic](https://anthropic.com) or reach out via our support channels.\n", + "\n", + "**Anthropic** – *Building reliable, interpretable, and safe AI systems for a better future.*" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "stream_brochure(\"Anthropic\", \"https://anthropic.com\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "id": "fdb3f8d8-a3eb-41c8-b1aa-9f60686a653b", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.co'}, {'type': 'enterprise page', 'url': 'https://huggingface.co/enterprise'}, {'type': 'pricing page', 'url': 'https://huggingface.co/pricing'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'blog page', 'url': 'https://huggingface.co/blog'}, {'type': 'discussion forum', 'url': 'https://discuss.huggingface.co'}, {'type': 'GitHub page', 'url': 'https://github.com/huggingface'}, {'type': 'Twitter page', 'url': 'https://twitter.com/huggingface'}, {'type': 'LinkedIn page', 'url': 'https://www.linkedin.com/company/huggingface/'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "# Hugging Face Brochure\n", + "\n", + "## About Us\n", + "**Hugging Face** is an innovative AI community dedicated to building the future through collaborative machine learning. Our platform serves as the home for researchers, developers, and organizations to create, discover, and utilize state-of-the-art models and datasets. With over 400,000 models and 100,000 datasets available, we foster a collaborative environment that empowers all participants in the machine learning ecosystem.\n", + "\n", + "## Our Offerings\n", + "- **Models**: Access to a vast library of machine learning models across various modalities, including text, images, videos, and more.\n", + "- **Datasets**: Comprehensive datasets to facilitate training and evaluation across multiple domains.\n", + "- **Spaces**: Host and share interactive machine learning applications easily.\n", + "- **Enterprise Solutions**: Tailored offerings that focus on security, support, and features for large organizations.\n", + "\n", + "## Customers\n", + "We proudly serve more than **50,000 organizations**, including prominent companies like:\n", + "- Amazon Web Services\n", + "- Google\n", + "- Microsoft\n", + "- Intel\n", + "- Grammarly\n", + "\n", + "Our community continues to grow, making it a thriving hub for AI-driven companies.\n", + "\n", + "## Company Culture\n", + "At Hugging Face, we prioritize community collaboration and open-source contributions. Our culture is built on the principles of transparency, inclusivity, and innovation, which are vital for advancing machine learning technology. We encourage our team members to engage in knowledge-sharing and continuous learning.\n", + "\n", + "## Careers\n", + "We are constantly looking for talented individuals to join our team. Opportunities range from research and development roles to positions in sales, marketing, and operations. If you're interested in being part of a forward-thinking AI organization, explore our current openings on our [careers page](#).\n", + "\n", + "## Join Us\n", + "Explore the exciting possibilities that Hugging Face has to offer! Whether you’re looking to collaborate on innovative machine learning models, deploy applications, or join our vibrant community, there's a place for you here.\n", + "\n", + "**Get Started Today!**\n", + "- Visit us at [Hugging Face](https://huggingface.co/)\n", + "- Connect with our community on [GitHub](https://github.com/huggingface), [Twitter](https://twitter.com/huggingface), [LinkedIn](https://www.linkedin.com/company/huggingface/)\n", + "\n", + "Together, let’s build the future of AI! 🌟" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "# Try changing the system prompt to the humorous version when you make the Brochure for Hugging Face:\n", "\n", diff --git a/week1/week1 EXERCISE.ipynb b/week1/week1 EXERCISE.ipynb index 3b74f8d..2c404f0 100644 --- a/week1/week1 EXERCISE.ipynb +++ b/week1/week1 EXERCISE.ipynb @@ -13,17 +13,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "c1070317-3ed9-4659-abe3-828943230e03", "metadata": {}, "outputs": [], "source": [ - "# imports" + "# imports\n", + "import os\n", + "import requests\n", + "import json\n", + "from typing import List\n", + "from dotenv import load_dotenv\n", + "from bs4 import BeautifulSoup\n", + "from IPython.display import Markdown, display, update_display\n", + "from openai import OpenAI\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "4a456906-915a-4bfd-bb9d-57e505c5093f", "metadata": {}, "outputs": [], @@ -36,24 +44,761 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "a8d7923c-5f28-4c30-8556-342d7c8497c1", "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "API key looks good so far\n" + ] + } + ], + "source": [ + "# set up environment\n", + "# Initialize and constants\n", + "\n", + "load_dotenv()\n", + "api_key = os.getenv('OPENAI_API_KEY')\n", + "\n", + "if api_key and api_key.startswith('sk-proj-') and len(api_key)>10:\n", + " print(\"API key looks good so far\")\n", + "else:\n", + " print(\"There might be a problem with your API key? Please visit the troubleshooting notebook!\")\n", + " \n", + "MODEL = 'gpt-4o-mini'\n", + "openai = OpenAI()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "38f13b72-eb43-4dbb-b80f-34f1625b6db8", + "metadata": {}, "outputs": [], "source": [ - "# set up environment" + "# A class to represent a Webpage\n", + "\n", + "class Website:\n", + " \"\"\"\n", + " A utility class to represent a Website that we have scraped, now with links\n", + " \"\"\"\n", + "\n", + " def __init__(self, url):\n", + " self.url = url\n", + " response = requests.get(url)\n", + " self.body = response.content\n", + " soup = BeautifulSoup(self.body, 'html.parser')\n", + " self.title = soup.title.string if soup.title else \"No title found\"\n", + " if soup.body:\n", + " for irrelevant in soup.body([\"script\", \"style\", \"img\", \"input\"]):\n", + " irrelevant.decompose()\n", + " self.text = soup.body.get_text(separator=\"\\n\", strip=True)\n", + " else:\n", + " self.text = \"\"\n", + " links = [link.get('href') for link in soup.find_all('a')]\n", + " self.links = [link for link in links if link]\n", + "\n", + " def get_contents(self):\n", + " return f\"Webpage Title:\\n{self.title}\\nWebpage Contents:\\n{self.text}\\n\\n\"" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, + "id": "1d853b19-28d7-49fe-a2af-b53b080b37bf", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['https://edwarddonner.com/',\n", + " 'https://edwarddonner.com/outsmart/',\n", + " 'https://edwarddonner.com/about-me-and-about-nebula/',\n", + " 'https://edwarddonner.com/posts/',\n", + " 'https://edwarddonner.com/',\n", + " 'https://news.ycombinator.com',\n", + " 'https://nebula.io/?utm_source=ed&utm_medium=referral',\n", + " 'https://www.prnewswire.com/news-releases/wynden-stark-group-acquires-nyc-venture-backed-tech-startup-untapt-301269512.html',\n", + " 'https://patents.google.com/patent/US20210049536A1/',\n", + " 'https://www.linkedin.com/in/eddonner/',\n", + " 'https://edwarddonner.com/2024/11/13/llm-engineering-resources/',\n", + " 'https://edwarddonner.com/2024/11/13/llm-engineering-resources/',\n", + " 'https://edwarddonner.com/2024/10/16/from-software-engineer-to-ai-data-scientist-resources/',\n", + " 'https://edwarddonner.com/2024/10/16/from-software-engineer-to-ai-data-scientist-resources/',\n", + " 'https://edwarddonner.com/2024/08/06/outsmart/',\n", + " 'https://edwarddonner.com/2024/08/06/outsmart/',\n", + " 'https://edwarddonner.com/2024/06/26/choosing-the-right-llm-resources/',\n", + " 'https://edwarddonner.com/2024/06/26/choosing-the-right-llm-resources/',\n", + " 'https://edwarddonner.com/',\n", + " 'https://edwarddonner.com/outsmart/',\n", + " 'https://edwarddonner.com/about-me-and-about-nebula/',\n", + " 'https://edwarddonner.com/posts/',\n", + " 'mailto:hello@mygroovydomain.com',\n", + " 'https://www.linkedin.com/in/eddonner/',\n", + " 'https://twitter.com/edwarddonner',\n", + " 'https://www.facebook.com/edward.donner.52']" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ed=Website(\"https://www.edwarddonner.com\")\n", + "ed.links" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "a64ccffe-06c5-49d9-ae06-067b6052f1ec", + "metadata": {}, + "outputs": [], + "source": [ + "#multi shots prmopting \n", + "#shot 1) you should respond in JSON... \n", + "#shot 2) you should also respond in multi colored text\n", + "\n", + "link_system_prompt = \"You are provided with a list of links found on a webpage. \\\n", + "You are able to decide which of the links would be most relevant to include in a brochure about the company, \\\n", + "such as links to an About page, or a Company page, or Careers/Jobs pages.\\n\"\n", + "link_system_prompt += \"You should respond in yellow text.\"\n", + "link_system_prompt += \"You should respond in JSON as in this example:\"\n", + "link_system_prompt += \"\"\"\n", + "{\n", + " \"links\": [\n", + " {\"type\": \"about page\", \"url\": \"https://full.url/goes/here/about\"},\n", + " {\"type\": \"careers page\": \"url\": \"https://another.full.url/careers\"}\n", + " ]\n", + "}\n", + "\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "38c058d0-d326-40dd-9925-1644288865b1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You are provided with a list of links found on a webpage. You are able to decide which of the links would be most relevant to include in a brochure about the company, such as links to an About page, or a Company page, or Careers/Jobs pages.\n", + "You should respond in yellow text.You should respond in JSON as in this example:\n", + "{\n", + " \"links\": [\n", + " {\"type\": \"about page\", \"url\": \"https://full.url/goes/here/about\"},\n", + " {\"type\": \"careers page\": \"url\": \"https://another.full.url/careers\"}\n", + " ]\n", + "}\n", + "\n" + ] + } + ], + "source": [ + "print(link_system_prompt)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "ea606951-a65a-4075-a473-58e4cddaf096", + "metadata": {}, + "outputs": [], + "source": [ + "def get_links_user_prompt(website):\n", + " user_prompt = f\"Here is the list of links on the website of {website.url} - \"\n", + " user_prompt += \"please decide which of these are relevant web links for a brochure about the company, respond with the full https URL in JSON format. \\\n", + "Do not include Terms of Service, Privacy, email links.\\n\"\n", + " user_prompt += \"print output in yellow text\\n\"\n", + " user_prompt += \"Links (some might be relative links):\\n\"\n", + " user_prompt += \"\\n\".join(website.links)\n", + " return user_prompt" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "96893ce7-865e-47e5-b637-2fab13305d5c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Here is the list of links on the website of https://www.edwarddonner.com - please decide which of these are relevant web links for a brochure about the company, respond with the full https URL in JSON format. Do not include Terms of Service, Privacy, email links.\n", + "print output in yellow text\n", + "Links (some might be relative links):\n", + "https://edwarddonner.com/\n", + "https://edwarddonner.com/outsmart/\n", + "https://edwarddonner.com/about-me-and-about-nebula/\n", + "https://edwarddonner.com/posts/\n", + "https://edwarddonner.com/\n", + "https://news.ycombinator.com\n", + "https://nebula.io/?utm_source=ed&utm_medium=referral\n", + "https://www.prnewswire.com/news-releases/wynden-stark-group-acquires-nyc-venture-backed-tech-startup-untapt-301269512.html\n", + "https://patents.google.com/patent/US20210049536A1/\n", + "https://www.linkedin.com/in/eddonner/\n", + "https://edwarddonner.com/2024/11/13/llm-engineering-resources/\n", + "https://edwarddonner.com/2024/11/13/llm-engineering-resources/\n", + "https://edwarddonner.com/2024/10/16/from-software-engineer-to-ai-data-scientist-resources/\n", + "https://edwarddonner.com/2024/10/16/from-software-engineer-to-ai-data-scientist-resources/\n", + "https://edwarddonner.com/2024/08/06/outsmart/\n", + "https://edwarddonner.com/2024/08/06/outsmart/\n", + "https://edwarddonner.com/2024/06/26/choosing-the-right-llm-resources/\n", + "https://edwarddonner.com/2024/06/26/choosing-the-right-llm-resources/\n", + "https://edwarddonner.com/\n", + "https://edwarddonner.com/outsmart/\n", + "https://edwarddonner.com/about-me-and-about-nebula/\n", + "https://edwarddonner.com/posts/\n", + "mailto:hello@mygroovydomain.com\n", + "https://www.linkedin.com/in/eddonner/\n", + "https://twitter.com/edwarddonner\n", + "https://www.facebook.com/edward.donner.52\n" + ] + } + ], + "source": [ + "print(get_links_user_prompt(ed))" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "716b214d-497e-49fb-a0de-5bf4edb0f6bd", + "metadata": {}, + "outputs": [], + "source": [ + "def get_links(url):\n", + " website = Website(url)\n", + " response = openai.chat.completions.create(\n", + " model=MODEL,\n", + " messages=[\n", + " {\"role\": \"system\", \"content\": link_system_prompt},\n", + " {\"role\": \"user\", \"content\": get_links_user_prompt(website)}\n", + " ],\n", + " response_format={\"type\": \"json_object\"}\n", + " )\n", + " result = response.choices[0].message.content\n", + " return json.loads(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "553b3d1c-4956-42d9-bd86-abaf764e3b5e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['https://edwarddonner.com/',\n", + " 'https://edwarddonner.com/outsmart/',\n", + " 'https://edwarddonner.com/about-me-and-about-nebula/',\n", + " 'https://edwarddonner.com/posts/',\n", + " 'https://edwarddonner.com/',\n", + " 'https://news.ycombinator.com',\n", + " 'https://nebula.io/?utm_source=ed&utm_medium=referral',\n", + " 'https://www.prnewswire.com/news-releases/wynden-stark-group-acquires-nyc-venture-backed-tech-startup-untapt-301269512.html',\n", + " 'https://patents.google.com/patent/US20210049536A1/',\n", + " 'https://www.linkedin.com/in/eddonner/',\n", + " 'https://edwarddonner.com/2024/11/13/llm-engineering-resources/',\n", + " 'https://edwarddonner.com/2024/11/13/llm-engineering-resources/',\n", + " 'https://edwarddonner.com/2024/10/16/from-software-engineer-to-ai-data-scientist-resources/',\n", + " 'https://edwarddonner.com/2024/10/16/from-software-engineer-to-ai-data-scientist-resources/',\n", + " 'https://edwarddonner.com/2024/08/06/outsmart/',\n", + " 'https://edwarddonner.com/2024/08/06/outsmart/',\n", + " 'https://edwarddonner.com/2024/06/26/choosing-the-right-llm-resources/',\n", + " 'https://edwarddonner.com/2024/06/26/choosing-the-right-llm-resources/',\n", + " 'https://edwarddonner.com/',\n", + " 'https://edwarddonner.com/outsmart/',\n", + " 'https://edwarddonner.com/about-me-and-about-nebula/',\n", + " 'https://edwarddonner.com/posts/',\n", + " 'mailto:hello@mygroovydomain.com',\n", + " 'https://www.linkedin.com/in/eddonner/',\n", + " 'https://twitter.com/edwarddonner',\n", + " 'https://www.facebook.com/edward.donner.52']" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "anthropic = Website(\"https://edwarddonner.com\")\n", + "anthropic.links" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "0d7b198d-a39f-4553-9432-0aaa8abbb0ec", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'links': [{'type': 'about page',\n", + " 'url': 'https://edwarddonner.com/about-me-and-about-nebula/'},\n", + " {'type': 'company page', 'url': 'https://edwarddonner.com/outsmart/'},\n", + " {'type': 'posts page', 'url': 'https://edwarddonner.com/posts/'}]}" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "get_links(\"https://edwarddonner.com\")" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "9d160a9e-a129-4d4f-be34-4ccc4e570c03", + "metadata": {}, + "outputs": [], + "source": [ + "#make a brouchore now\n", + "def get_all_details(url):\n", + " result = \"Landing page:\\n\"\n", + " result += Website(url).get_contents()\n", + " links = get_links(url)\n", + " print(\"Found links:\", links)\n", + " for link in links[\"links\"]:\n", + " result += f\"\\n\\n{link['type']}\\n\"\n", + " result += Website(link[\"url\"]).get_contents()\n", + " return result" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "6ce3de06-f228-4f8c-ad65-522b25c1dcf5", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://edwarddonner.com/about-me-and-about-nebula/'}]}\n", + "Landing page:\n", + "Webpage Title:\n", + "Home - Edward Donner\n", + "Webpage Contents:\n", + "Home\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "Well, hi there.\n", + "I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n", + "very\n", + "amateur) and losing myself in\n", + "Hacker News\n", + ", nodding my head sagely to things I only half understand.\n", + "I’m the co-founder and CTO of\n", + "Nebula.io\n", + ". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n", + "acquired in 2021\n", + ".\n", + "We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n", + "patented\n", + "our matching model, and our award-winning platform has happy customers and tons of press coverage.\n", + "Connect\n", + "with me for more!\n", + "November 13, 2024\n", + "Mastering AI and LLM Engineering – Resources\n", + "October 16, 2024\n", + "From Software Engineer to AI Data Scientist – resources\n", + "August 6, 2024\n", + "Outsmart LLM Arena – a battle of diplomacy and deviousness\n", + "June 26, 2024\n", + "Choosing the Right LLM: Toolkit and Resources\n", + "Navigation\n", + "Home\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "Get in touch\n", + "ed [at] edwarddonner [dot] com\n", + "www.edwarddonner.com\n", + "Follow me\n", + "LinkedIn\n", + "Twitter\n", + "Facebook\n", + "Subscribe to newsletter\n", + "Type your email…\n", + "Subscribe\n", + "\n", + "\n", + "\n", + "about page\n", + "Webpage Title:\n", + "About - Edward Donner\n", + "Webpage Contents:\n", + "Home\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "About\n", + "I’m the co-founder and CTO of\n", + "Nebula.io\n", + ". We help recruiters source, understand, engage and manage talent, using Generative AI and other forms of machine learning. Our\n", + "patented\n", + "model matches people with roles with greater accuracy and speed than previously imaginable — no keywords required. Take a look for yourself; it’s completely free to try.\n", + "Our long term goal is to help people discover their potential and pursue their reason for being, motivated by a concept called\n", + "Ikigai\n", + ". We help people find roles where they will be most fulfilled and successful; as a result, we will raise the level of human prosperity. It sounds grandiose, but since 77% of people don’t consider themselves\n", + "inspired or engaged\n", + "at work, it’s completely within our reach.\n", + "I sometimes have to pinch myself. I’m incredibly lucky to be working in the field of AI at a time when it’s rewriting the boundaries of human and tech possibilities. I’m personally most drawn to applying AI to real world problems, and the specific problem of hiring has plagued me throughout my career. So I’m in the business of finding people their dream jobs — and conveniently, I’m in my dream job myself.\n", + "Before Nebula.io\n", + "You can trace the roots of Nebula.io to an AI startup I founded in 2013 called\n", + "untapt\n", + ". We built talent marketplaces and data science software for recruitment firms. To start with, we specialized on tech roles in financial services, where there was a huge supply/demand gap.\n", + "We were selected to be part of a prestigious accelerator program – the\n", + "Accenture FinTech Innovation Lab\n", + "– and we were an\n", + "American Banker Top 20 Company To Watch\n", + ". We were covered in\n", + "Fast Company\n", + ",\n", + "Forbes\n", + "and\n", + "American Banker\n", + ", and I was interviewed on the floor of the New York Stock Exchange and Nasdaq:\n", + "After a 20 year career in Financial Services, the most rewarding thing to me about untapt was that we were tackling\n", + "tangible real-world problems\n", + "faced by everyone. I loved that we had billboard ads in train stations and we got to speak to our end-users every day. One of my proudest moments: at an Amazon pitch event to people in tech, we were voted the ‘startup most likely to grow exponentially’.\n", + "And then, our path to exponential growth was accelerated suddenly and wonderfully. Our top client, recruitment powerhouse GQR, was interested in a deeper partnership. In 2021 untapt was\n", + "acquired\n", + "by GQR’s parent company, and shortly afterwards, Nebula.io was born.\n", + "My request to you\n", + "My New Year’s Resolution is to do a better job of networking. That’s where you come in. If any of this sounds interesting, please\n", + "connect with me\n", + "for a virtual coffee. Or even a real coffee, if you’re in NYC.\n", + "I have broad expertise that spans software engineering, data science, technology leadership, entrepreneurship, and anything made by Apple. My notable prowess in these areas is only surpassed by my inability to perform anything requiring hand/eye coordination. Do not be fooled by my final pictures: if you’re looking for someone to join your Amazing Race team, or your America’s Got Talent crew, or really anything that requires functioning outdoors.. you probably want anyone but me.\n", + "Loading Comments...\n", + "Write a Comment...\n", + "Email (Required)\n", + "Name (Required)\n", + "Website\n", + "\n", + "\n" + ] + } + ], + "source": [ + "print(get_all_details(\"https://edwarddonner.com\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "id": "7c019742-9586-4061-96ff-912af9802bb5", + "metadata": {}, + "outputs": [], + "source": [ + "system_prompt = \"You are an assistant that analyzes the contents of several relevant pages from a company website \\\n", + "and creates a short brochure about the company for prospective customers, investors and recruits. Respond in markdown.\\\n", + "Include details of company culture, customers and careers/jobs if you have the information.\\\n", + "Output should be displayed in mindmap diagram format.\\\n", + "Also output should be in Hindi lanaguage.\"\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "id": "8152a14f-91e8-4abc-89c7-6062934611fa", + "metadata": {}, + "outputs": [], + "source": [ + "def get_brochure_user_prompt(company_name, url):\n", + " user_prompt = f\"You are looking at a company called: {company_name}\\n\"\n", + " user_prompt += f\"Here are the contents of its landing page and other relevant pages; use this information to build a short brochure of the company in markdown.\\n\"\n", + " user_prompt += get_all_details(url)\n", + " user_prompt = user_prompt[:20_000] # Truncate if more than 20,000 characters\n", + " return user_prompt" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "id": "009ab063-eb0e-4d6e-b833-406277a0c70f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://edwarddonner.com/about-me-and-about-nebula/'}]}\n" + ] + }, + { + "data": { + "text/plain": [ + "'You are looking at a company called: Edward Donner\\nHere are the contents of its landing page and other relevant pages; use this information to build a short brochure of the company in markdown.\\nLanding page:\\nWebpage Title:\\nHome - Edward Donner\\nWebpage Contents:\\nHome\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nWell, hi there.\\nI’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\\nvery\\namateur) and losing myself in\\nHacker News\\n, nodding my head sagely to things I only half understand.\\nI’m the co-founder and CTO of\\nNebula.io\\n. We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\\nacquired in 2021\\n.\\nWe work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\\npatented\\nour matching model, and our award-winning platform has happy customers and tons of press coverage.\\nConnect\\nwith me for more!\\nNovember 13, 2024\\nMastering AI and LLM Engineering – Resources\\nOctober 16, 2024\\nFrom Software Engineer to AI Data Scientist – resources\\nAugust 6, 2024\\nOutsmart LLM Arena – a battle of diplomacy and deviousness\\nJune 26, 2024\\nChoosing the Right LLM: Toolkit and Resources\\nNavigation\\nHome\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nGet in touch\\ned [at] edwarddonner [dot] com\\nwww.edwarddonner.com\\nFollow me\\nLinkedIn\\nTwitter\\nFacebook\\nSubscribe to newsletter\\nType your email…\\nSubscribe\\n\\n\\n\\nabout page\\nWebpage Title:\\nAbout - Edward Donner\\nWebpage Contents:\\nHome\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nAbout\\nI’m the co-founder and CTO of\\nNebula.io\\n. We help recruiters source, understand, engage and manage talent, using Generative AI and other forms of machine learning. Our\\npatented\\nmodel matches people with roles with greater accuracy and speed than previously imaginable — no keywords required. Take a look for yourself; it’s completely free to try.\\nOur long term goal is to help people discover their potential and pursue their reason for being, motivated by a concept called\\nIkigai\\n. We help people find roles where they will be most fulfilled and successful; as a result, we will raise the level of human prosperity. It sounds grandiose, but since 77% of people don’t consider themselves\\ninspired or engaged\\nat work, it’s completely within our reach.\\nI sometimes have to pinch myself. I’m incredibly lucky to be working in the field of AI at a time when it’s rewriting the boundaries of human and tech possibilities. I’m personally most drawn to applying AI to real world problems, and the specific problem of hiring has plagued me throughout my career. So I’m in the business of finding people their dream jobs — and conveniently, I’m in my dream job myself.\\nBefore Nebula.io\\nYou can trace the roots of Nebula.io to an AI startup I founded in 2013 called\\nuntapt\\n. We built talent marketplaces and data science software for recruitment firms. To start with, we specialized on tech roles in financial services, where there was a huge supply/demand gap.\\nWe were selected to be part of a prestigious accelerator program – the\\nAccenture FinTech Innovation Lab\\n– and we were an\\nAmerican Banker Top 20 Company To Watch\\n. We were covered in\\nFast Company\\n,\\nForbes\\nand\\nAmerican Banker\\n, and I was interviewed on the floor of the New York Stock Exchange and Nasdaq:\\nAfter a 20 year career in Financial Services, the most rewarding thing to me about untapt was that we were tackling\\ntangible real-world problems\\nfaced by everyone. I loved that we had billboard ads in train stations and we got to speak to our end-users every day. One of my proudest moments: at an Amazon pitch event to people in tech, we were voted the ‘startup most likely to grow exponentially’.\\nAnd then, our path to exponential growth was accelerated suddenly and wonderfully. Our top client, recruitment powerhouse GQR, was interested in a deeper partnership. In 2021 untapt was\\nacquired\\nby GQR’s parent company, and shortly afterwards, Nebula.io was born.\\nMy request to you\\nMy New Year’s Resolution is to do a better job of networking. That’s where you come in. If any of this sounds interesting, please\\nconnect with me\\nfor a virtual coffee. Or even a real coffee, if you’re in NYC.\\nI have broad expertise that spans software engineering, data science, technology leadership, entrepreneurship, and anything made by Apple. My notable prowess in these areas is only surpassed by my inability to perform anything requiring hand/eye coordination. Do not be fooled by my final pictures: if you’re looking for someone to join your Amazing Race team, or your America’s Got Talent crew, or really anything that requires functioning outdoors.. you probably want anyone but me.\\nLoading Comments...\\nWrite a Comment...\\nEmail (Required)\\nName (Required)\\nWebsite\\n\\n'" + ] + }, + "execution_count": 80, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "get_brochure_user_prompt(\"Edward Donner\", \"https://edwarddonner.com\") " + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "id": "bcccadb8-11d6-4ddd-a24f-6ac1c2101419", + "metadata": {}, + "outputs": [], + "source": [ + "def create_brochure(company_name, url):\n", + " response = openai.chat.completions.create(\n", + " model=MODEL,\n", + " messages=[\n", + " {\"role\": \"system\", \"content\": system_prompt},\n", + " {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n", + " ],\n", + " )\n", + " result = response.choices[0].message.content\n", + " display(Markdown(result))" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "id": "3606b154-8d28-49ca-8028-c064f196fe20", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://anthropic.com/company'}, {'type': 'careers page', 'url': 'https://anthropic.com/careers'}, {'type': 'team page', 'url': 'https://anthropic.com/team'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "```markdown\n", + "# Anthropic कंपनी ब्रोशर\n", + "\n", + "## कंपनी की जानकारी\n", + "- **नाम:** Anthropic\n", + "- **मुख्यालय:** सैन फ्रांसिस्को\n", + "- **व्यापार प्रकार:** AI सुरक्षा और अनुसंधान कंपनी\n", + "- **उद्देश्य:** विश्व में AI का सकारात्मक प्रभाव सुनिश्चित करना \n", + "\n", + "## हमारे उत्पाद\n", + "- **Claude 3.5 Sonnet:** Intelligent AI मॉडल\n", + "- **Claude API:** व्यवसायों के लिए AI की शक्ति का उपयोग करें\n", + "- **Claude for Enterprise:** विशेष रूप से व्यावसायिक उपयोग के लिए डिज़ाइन किया गया\n", + "\n", + "## कंपनी संस्कृति\n", + "- **उच्च विश्वास:** ईमानदारी, समझदारी और सहयोग पर आधारित वातावरण।\n", + "- **एक बड़ी टीम:** सभी टीमों के बीच सहयोग और विचारों का आदान-प्रदान।\n", + "- **सरलता पर जोर:** जटिलता से बचना और व्यावहारिक समाधान पर ध्यान केंद्रित करना।\n", + "- **सुरक्षा एक विज्ञान:** उत्पादों में सुरक्षा तकनीकों का उपयोग और साझा करना।\n", + "\n", + "## ग्राहक\n", + "- विविध इंडस्ट्रीज: व्यवसाय, गैर-लाभकारी संगठन और नागरिक समाज समूह\n", + "- **उपभोक्ताओं का फीडबैक:** व्यवसायों में कार्यक्षमता को बढ़ाने के लिए Claude का इस्तेमाल करने वाले ग्राहकों से सकारात्मक अनुभव।\n", + "\n", + "## करियर और नौकरियां\n", + "- **ओपन रोल्स:** अनुसंधान, इंजीनियरिंग, नीति, और संचालन में विविध पृष्ठभूमियों के लिए।\n", + "- **लाभ और भत्ते:**\n", + " - स्वास्थ्य, दंत और दृष्टि बीमा\n", + " - 22 सप्ताह का भुगतान किया गया माता-पिता अवकाश\n", + " - प्रतिस्पर्धी वेतन और शेयर पैकेज\n", + " - दूरस्थ काम की चालकता\n", + "\n", + "## करियर में शामिल कैसे हों\n", + "1. **रिज़्युमे सबमिट करें**\n", + "2. **चर्चा करें:** आपकी रुचियों और अनुभव के बारे में।\n", + "3. **कौशल आकलन:** तकनीकी और राजनीतिक भूमिकाओं के लिए परीक्षण।\n", + "\n", + "## संपर्क जानकारी\n", + "- **सोशल मीडिया:** ट्विटर, लिंक्डइन, यूट्यूब\n", + "- **वेबसाइट:** [Anthropic](https://www.anthropic.com)\n", + "\n", + "Anthropic में शामिल होने और एआई की भविष्यवाणी को सुरक्षित करने के लिए आइए!\n", + "```\n", + "\n", + "### मानसिक मानचित्र\n", + "```plaintext\n", + "Anthropic\n", + "│\n", + "├── कंपनी की जानकारी\n", + "│ ├── नाम: Anthropic\n", + "│ ├── मुख्यालय: सैन फ्रांसिस्को\n", + "│ └── उद्देश्य: AI का सकारात्मक प्रभाव\n", + "│\n", + "├── उत्पाद\n", + "│ ├── Claude 3.5 Sonnet\n", + "│ ├── Claude API\n", + "│ └── Claude for Enterprise\n", + "│\n", + "├── कंपनी संस्कृति\n", + "│ ├── उच्च विश्वास\n", + "│ ├── एक बड़ी टीम\n", + "│ ├── सरलता पर जोर\n", + "│ └── सुरक्षा एक विज्ञान\n", + "│\n", + "├── ग्राहक\n", + "│ ├── विविध इंडस्ट्रीज\n", + "│ └── उपभोक्ताओं का फीडबैक\n", + "│\n", + "└── करियर और नौकरियां\n", + " ├── ओपन रोल्स\n", + " ├── लाभ और भत्ते\n", + " └── शामिल होने की प्रक्रिया\n", + "``` \n", + "\n", + "इस ब्रोशर का लक्ष्य संभावित ग्राहकों, निवेशकों और कर्मचारियों को Anthropic के बारे में जानकारी प्रदान करना और इसकी लाभदायक और सहयोगात्मक संस्कृति को उजागर करना है।" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "create_brochure(\"Anthropic\", \"https://anthropic.com\")" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "id": "757b9f43-9c23-477b-9928-d6bbbf0394bb", + "metadata": {}, + "outputs": [], + "source": [ + "#stream brochure\n", + "def stream_brochure(company_name, url):\n", + " stream = openai.chat.completions.create(\n", + " model=MODEL,\n", + " messages=[\n", + " {\"role\": \"system\", \"content\": system_prompt},\n", + " {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n", + " ],\n", + " stream=True\n", + " )\n", + " \n", + " response = \"\"\n", + " display_handle = display(Markdown(\"\"), display_id=True)\n", + " for chunk in stream:\n", + " response += chunk.choices[0].delta.content or ''\n", + " response = response.replace(\"```\",\"\").replace(\"markdown\", \"\")\n", + " update_display(Markdown(response), display_id=display_handle.display_id)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "id": "ea4408f4-dbdc-4168-a843-034b9620fb38", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.com/huggingface'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'enterprise page', 'url': 'https://huggingface.com/enterprise'}, {'type': 'pricing page', 'url': 'https://huggingface.com/pricing'}, {'type': 'blog page', 'url': 'https://huggingface.com/blog'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "\n", + "# Hugging Face Brochure\n", + "\n", + "## 🤖 कंपनी का परिचय\n", + "- **नाम:** Hugging Face\n", + "- **संक्षेप:** Hugging Face एक AI समुदाय है जो भविष्य का निर्माण कर रहा है। यह मशीन लर्निंग समुदाय के लिए एक ऐसा प्लेटफॉर्म है, जहाँ मॉडल, डेटासेट और अनुप्रयोगों पर सहयोग किया जा सकता है।\n", + "\n", + "## 🌟 हमारी विशेषताएँ\n", + "- **मॉडल:** 400k+ मॉडल्स की मेज़बानी।\n", + "- **डेटासेट्स:** 100k+ डेटासेट्स उपलब्ध हैं।\n", + "- **स्पेस:** 150k+ एप्लिकेशन्स का संग्रह।\n", + "- **तकनीक:** ओपन-सोर्स तकनीक के साथ मशीन लर्निंग में सहयोग बढ़ाना।\n", + "- **एन्टरप्राइज समाधान:** 20 डॉलर प्रति उपयोगकर्ता प्रति माह से शुरू।\n", + "\n", + "## 🌍 ग्राहक\n", + "- **उद्योग:** 50,000+ संगठन Hugging Face का उपयोग करते हैं, जिनमें Meta, Google, Microsoft जैसे बड़े नाम शामिल हैं।\n", + "\n", + "## 🌈 कंपनी संस्कृति\n", + "- **लक्ष्य:** अच्छे मशीन लर्निंग को लोकतांत्रिक बनाने का मिशन।\n", + "- **समुदाय:** सभी को जुड़ने, साझा करने और सहयोग करने हेतु आमंत्रित किया जाता है।\n", + "\n", + "## 💼 करियर\n", + "- **संभावनाएँ:** स्थानीय और वैश्विक स्तर पर कई रोजगार अवसर उपलब्ध हैं।\n", + "- **संस्कृति:** एक सहयोगात्मक वातावरण जिसमें नवाचार और सामूहिक सीखने पर जोर दिया जाता है।\n", + "\n", + "## 💬 संपरक\n", + "- **वेबसाइट:** [Hugging Face](https://huggingface.co)\n", + "- **सोशल मीडिया:** GitHub, Twitter, LinkedIn और Discord पर हमें फॉलो करें।\n", + "\n", + "## 📝 मूल्य निर्धारण\n", + "- **फ्री:** बेसिक उपयोग के लिए हमेशा मुफ़्त।\n", + "- **प्रो:** $9 प्रति माह के लिए एडवांस फीचर्स।\n", + "- **एंटरप्राइज:** सुरक्षा और विशेष समर्थन के साथ सर्वश्रेष्ठ प्लेटफार्म।\n", + "\n", + "---\n", + "\n", + "### 👥 जुड़ें\n", + "आप हमारी टीम का हिस्सा बन सकते हैं और इस ऊर्जा से भरे समुदाय में शामिल हो सकते हैं। यदि आप अच्छा मशीन लर्निंग विकास करने में रुचि रखते हैं, तो **आज ही शामिल हों!**\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "stream_brochure(\"HuggingFace\", \"https://huggingface.com\")" + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "id": "256765bb-a307-4fe0-9582-f03403a25e8d", + "metadata": {}, + "outputs": [], + "source": [ + "#define new system prompt for the question below\n", + "\n", + "system_prompt = \"Output should be in both English and Hindi lanaguage.\"" + ] + }, + { + "cell_type": "code", + "execution_count": 99, "id": "3f0d0137-52b0-47a8-81a8-11a90a010798", "metadata": {}, "outputs": [], "source": [ - "# here is the question; type over this to ask something new\n", + "# here is the question; type over this to ask something new , i.e. user_prompt\n", "\n", - "question = \"\"\"\n", + "user_prompt = question = \"\"\"\n", "Please explain what this code does and why:\n", "yield from {book.get(\"author\") for book in books if book.get(\"author\")}\n", "\"\"\"" @@ -61,23 +806,179 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 100, "id": "60ce7000-a4a5-4cce-a261-e75ef45063b4", "metadata": {}, "outputs": [], "source": [ - "# Get gpt-4o-mini to answer, with streaming" + "# Get gpt-4o-mini to answer, with streaming\n", + "#stream result\n", + "def stream_code_explanation():\n", + " stream = openai.chat.completions.create(\n", + " model=MODEL,\n", + " messages=[\n", + " {\"role\": \"system\", \"content\": system_prompt},\n", + " {\"role\": \"user\", \"content\": user_prompt}\n", + " ],\n", + " stream=True\n", + " )\n", + " \n", + " response = \"\"\n", + " display_handle = display(Markdown(\"\"), display_id=True)\n", + " for chunk in stream:\n", + " response += chunk.choices[0].delta.content or ''\n", + " response = response.replace(\"```\",\"\").replace(\"markdown\", \"\")\n", + " update_display(Markdown(response), display_id=display_handle.display_id)" ] }, { "cell_type": "code", - "execution_count": null, - "id": "8f7c8ea8-4082-4ad0-8751-3301adcf6538", + "execution_count": 101, + "id": "a7c79f95-6a4f-48b1-afed-42848e5d5975", + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "This code snippet uses a generator expression combined with a set comprehension. Let's break down what it does:\n", + "\n", + "### Explanation:\n", + "\n", + "1. **`{book.get(\"author\") for book in books if book.get(\"author\")}`**: \n", + " - This part is a set comprehension. It iterates through each `book` in the `books` collection (which is assumed to be a list or similar iterable).\n", + " - For each `book`, it retrieves the value associated with the key `\"author\"` using the `book.get(\"author\")` method.\n", + " - The `if book.get(\"author\")` condition ensures that only books that have an author value (i.e., not `None` or an empty string) are considered.\n", + " - Since this is a set comprehension, it will only include unique authors in the resulting set.\n", + "\n", + "2. **`yield from`**: \n", + " - The `yield from` statement is used in a generator function to yield all values from the iterable that follows it. In this case, it yields all the unique authors obtained from the set comprehension.\n", + " \n", + "### Purpose and Use:\n", + "The purpose of this code is to create a generator that yields unique authors from a list of books, excluding any entries that lack an author.\n", + "\n", + "### Example Use Case:\n", + "Suppose you have a collection of book records, and you want to create a list of distinct authors for further processing or display. This code effectively filters out any entries without valid author names and provides a way to iterate over only unique authors.\n", + "\n", + "### Hindi Explanation:\n", + "\n", + "यह कोड स्निपेट एक जनरेटर एक्सप्रेशन और सेट कम्प्रिहेंशन का उपयोग करता है। आइए इसे विभाजित करें:\n", + "\n", + "1. **`{book.get(\"author\") for book in books if book.get(\"author\")}`**: \n", + " - यह एक सेट कम्प्रिहेंशन है। यह `books` संग्रह (जो एक सूची या समान इटरेबल समझा जा रहा है) में हर `book` के लिएiterate करता है।\n", + " - हर `book` के लिए, यह `book.get(\"author\")` विधि का उपयोग करके `\"author\"` कुंजी से संबंधित मान प्राप्त करता है।\n", + " - `if book.get(\"author\")` शर्त यह सुनिश्चित करती है कि केवल वही पुस्तकें जिनका लेखक मान (यानी, `None` या एक खाली स्ट्रिंग नहीं है) पर विचार किया जाए।\n", + " - चूंकि यह एक सेट कम्प्रिहेंशन है, यह अद्वितीय लेखकों को परिणामी सेट में शामिल करेगा।\n", + "\n", + "2. **`yield from`**: \n", + " - `yield from` वाक्यांश जनरेटर फ़ंक्शन में एक इटरेबल से सभी मानों को निकालने के लिए प्रयोग किया जाता है जो इसके बाद आता है। इस मामले में, यह सेट कम्प्रिहेंशन से प्राप्त अद्वितीय लेखकों के सभी मानों को प्रदान करता है।\n", + "\n", + "### उद्देश्य और उपयोग:\n", + "इस कोड का उद्देश्य पुस्तकों की सूची से अद्वितीय लेखकों को उत्पन्न करने के लिए एक जनरेटर बनाना है, जिसमें किसी भी प्रविष्टियों को बाहर रखा गया है जिनमें लेखक नहीं है।\n", + "\n", + "### उदाहरण उपयोग मामला:\n", + "मान लीजिए कि आपके पास पुस्तक रिकॉर्ड का एक संग्रह है, और आप विशिष्ट लेखकों की एक सूची बनाना चाहते हैं ताकि उसे आगे की प्रक्रिया या प्रदर्शन के लिए साझा किया जा सके। यह कोड केवल मान्य लेखक नामों को प्रदर्शित करके आपको केवल अद्वितीय लेखकों पर इटरट करने का एक तरीका प्रदान करता है।" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "stream_code_explanation()" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "id": "350eb627-23a3-4215-82be-e5b8f99280e2", + "metadata": {}, + "outputs": [], + "source": [ + "OLLAMA_API = \"http://localhost:11434/api/chat\"\n", + "HEADERS = {\"Content-Type\": \"application/json\"}" + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "id": "652739e1-6edd-4b9d-8a44-8ea8191f45a4", "metadata": {}, "outputs": [], "source": [ - "# Get Llama 3.2 to answer" + "# Create a messages list using the same format that we used for OpenAI\n", + "messages = [\n", + " {\"role\": \"user\", \"content\": \"Please explain what this code does and why: yield from {book.get(\\\"author\\\") for book in books if book.get(\\\"author\\\")}\"}\n", + "]" ] + }, + { + "cell_type": "code", + "execution_count": 133, + "id": "0d1b895b-1ba2-4ea2-95a5-fe7a798a4157", + "metadata": {}, + "outputs": [], + "source": [ + "payload = {\n", + " \"model\": MODEL_LLAMA,\n", + " \"messages\": messages,\n", + " \"stream\": False\n", + " }" + ] + }, + { + "cell_type": "code", + "execution_count": 135, + "id": "8f7c8ea8-4082-4ad0-8751-3301adcf6538", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This line of code is written in Python and utilizes a feature called \"yield from\" which was introduced in Python 3.3.\n", + "\n", + "**What it does:**\n", + "\n", + "The `yield from` statement is used to yield results from another iterable. In this specific case, it's used to generate an iterator that yields the authors of books found in the `books` collection.\n", + "\n", + "Here's a breakdown:\n", + "\n", + "- `{book.get(\"author\") for book in books if book.get(\"author\")}`: This is a generator expression. It creates an iterable (an iterator) that generates values from each iteration of the loop.\n", + " - `for book in books`: Loops through each item (`book`) in the `books` collection.\n", + " - `if book.get(\"author\")`: Only includes items where the \"author\" key exists and its value is not empty or None. This is to filter out any dictionaries that don't have an author.\n", + " - `book.get(\"author\")`: Retrieves the value of the \"author\" key from each filtered dictionary.\n", + "\n", + "- `yield from ...`: Yields all values generated by the inner iterable (the generator expression).\n", + "\n", + "So, putting it together, this line of code generates a sequence of authors for books in the `books` collection, but only includes authors that are present in the books' data.\n", + "\n", + "**Why:**\n", + "\n", + "Using `yield from` is more efficient than using a loop with an append method when dealing with large datasets. Here's why:\n", + "\n", + "- Without `yield from`, you'd have to create a list and then yield each item one by one, which would be memory-intensive.\n", + "- With `yield from`, the function only yields values once they're generated, so it doesn't need to store them in memory beforehand.\n", + "\n", + "In this case, if the `books` collection is very large, using `yield from` would save a lot of memory and make your code more efficient.\n" + ] + } + ], + "source": [ + "# Get Llama 3.2 to answer\n", + "response = requests.post(OLLAMA_API, json=payload, headers=HEADERS)\n", + "print(response.json()['message']['content'])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd9b22dd-cc77-4f1d-80ca-da45fe122dab", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {