{"id":23933527,"url":"https://github.com/afondiel/ChatGPT-Prompt-Engineering-DeepLearningAI","last_synced_at":"2025-09-11T16:32:02.572Z","repository":{"id":213379447,"uuid":"655895225","full_name":"afondiel/ChatGPT-Prompt-Engineering-DeepLearningAI","owner":"afondiel","description":"ChatGPT Prompt Engineering for Developers Crash \u0026 Free Course by DeepLearning.AI","archived":false,"fork":false,"pushed_at":"2023-12-20T16:30:43.000Z","size":1374,"stargazers_count":28,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-02T10:05:01.444Z","etag":null,"topics":["agi","anthropic","bard","chatbot","chatgpt","chatgpt-api","claude","cohere","deeplearningai","gemini","generativeai","gpt","huggingface","langchain","llm","mistral","openai","prompt","prompt-engineering"],"latest_commit_sha":null,"homepage":"https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/1/introduction","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afondiel.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-19T20:51:09.000Z","updated_at":"2024-12-09T16:18:24.000Z","dependencies_parsed_at":"2023-12-20T18:02:34.550Z","dependency_job_id":null,"html_url":"https://github.com/afondiel/ChatGPT-Prompt-Engineering-DeepLearningAI","commit_stats":null,"previous_names":["afondiel/chatgpt-prompt-engineering-deeplearningai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afondiel","download_url":"https://codeload.github.com/afondiel/ChatGPT-Prompt-Engineering-DeepLearningAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232658684,"owners_count":18556988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agi","anthropic","bard","chatbot","chatgpt","chatgpt-api","claude","cohere","deeplearningai","gemini","generativeai","gpt","huggingface","langchain","llm","mistral","openai","prompt","prompt-engineering"],"created_at":"2025-01-06T00:29:44.975Z","updated_at":"2025-01-06T00:32:51.501Z","avatar_url":"https://github.com/afondiel.png","language":"Jupyter Notebook","readme":"# ChatGPT Prompt Engineering by DeepLearning.AI\n\n\n## Overview\n\nThis crash \u0026 free course on ChatGPT Prompt Engineering is offered by [DeepLearning.AI](https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/1/introduction) and lectured by `Andrew Ng` and `Isa Fulford` from [openai](openai.com).\n\n## Course Plan\n\n- [Lesson1: Introduction](./l1-intro-notes.md)\n- [Lesson2: Guidelines](./l2-guidelines-notes.md)\n- [Lesson3: Iterative](./l3-iterative-prompt-dev.md)\n- [Lesson4: Summarizing](./l4-summarizing.md)\n- [Lesson5: Inferring](./l5-inferring.md)\n- [Lesson6: Transforming](./l6-transforming.md)\n- [Lesson7: Expanding](./l7-expanding.md)\n- [Lesson8: Chatbot](./l8-chatbot.md)\n- [Lesson9: Conclusion](./l9-conclusion.md)\n\n\u003e All notebook examples are available in the [lab](./lab/) folder.\n## Setup\n\nLoad the API key and relevant Python libaries\n\n\n```python\nimport openai\nimport os\n\nfrom dotenv import load_dotenv, find_dotenv\n_ = load_dotenv(find_dotenv())\n\nopenai.api_key  = os.getenv('OPENAI_API_KEY')\n```\n\n**Helper function**\n\n- This function will make it easier to use prompts and look at the generated outputs:\n\nIt uses OpenAI's `gpt-3.5-turbo` model and the [chat completions endpoint](https://platform.openai.com/docs/guides/chat).\n\n\n```python\n\ndef get_completion(prompt, model=\"gpt-3.5-turbo\"):\n    messages = [{\"role\": \"user\", \"content\": prompt}]\n    response = openai.ChatCompletion.create(\n        model=model,\n        messages=messages,\n        temperature=0, # this is the degree of randomness of the model's output\n    )\n    return response.choices[0].message[\"content\"]\n```\n### Usage\n\n```python\ntext = f\"\"\"\nYou should express what you want a model to do by \\ \nproviding instructions that are as clear and \\ \nspecific as you can possibly make them. \\ \nThis will guide the model towards the desired output, \\ \nand reduce the chances of receiving irrelevant \\ \nor incorrect responses. Don't confuse writing a \\ \nclear prompt with writing a short prompt. \\ \nIn many cases, longer prompts provide more clarity \\ \nand context for the model, which can lead to \\ \nmore detailed and relevant outputs.\n\"\"\"\nprompt = f\"\"\"\nSummarize the text delimited by triple backticks \\ \ninto a single sentence.\n```{text}```\n\"\"\"\nresponse = get_completion(prompt)\nprint(response)\n```\n#### Completion : \n\n```\nClear and specific instructions should be provided to guide a model towards the desired output, and longer prompts can provide more clarity and context for the model, leading to more detailed and relevant outputs.\n```\n\n\n## References\n\nMain Course : \n- https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/1/introduction\n\nOthers short Free Courses available on DeepLearning.AI : \n- https://learn.deeplearning.ai/\n\n\n\n\n\n","funding_links":[],"categories":["Building"],"sub_categories":["Prompt Engineering"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafondiel%2FChatGPT-Prompt-Engineering-DeepLearningAI/lists"}