生成式AI的提示工程(影印版)
生成式AI的提示工程(影印版)
James Phoenix, Mike Taylor
出版时间:2025年02月
页数:401
“这是我读过的关于提示工程的最佳书籍。Mike和James都是该领域的行家里手。”
——Dan Shipper
Every联合创始人兼CEO
“如果你想提高AI系统的准确性和可靠性,你的书架上绝对不能少了这本书。”
——Mayo Oshin
Siennai Analytics创始人兼CEO,LangChain早期贡献者

ChatGPT和DALL-E这样的大语言模型(LLM)和扩散模型拥有前所未有的潜力。通过使用互联网上的公共文本和图像进行训练,这些模型能够为各种任务提供帮助。而且,随着准入门槛的显著降低,几乎任何开发人员都可以利用AI模型来解决以前不适合自动化的问题。
借助本书,你将在生成式人工智能方面打下坚实的基础,学会如何在实践中应用这些模型。在将大语言模型和扩散模型集成到工作流中时,大多数开发人员很难获得可用于自动化系统的可靠结果。作者James Phoenix和Mike Taylor展示了如何通过提示工程原则在生产过程中有效使用AI。
本书讲解了:
● 可跨模型使用且具有前瞻性的五大提示原则
● 使用LangChain等库和框架将生成式AI应用于现实案例
● 对GPT-4和DALL-E 2等OpenAI模型与包括开源模型在内的其他替代方案进行评估,比较它们的优缺点
● 这些原则在NLP、文本和图像生成以及代码领域的实际应用
  1. Preface
  2. 1. The Five Principles of Prompting
  3. Overview of the Five Principles of Prompting
  4. 1. Give Direction
  5. 2. Specify Format
  6. 3. Provide Examples
  7. 4. Evaluate Quality
  8. 5. Divide Labor
  9. Summary
  10. 2. Introduction to Large Language Models for Text Generation
  11. What Are Text Generation Models?
  12. Historical Underpinnings: The Rise of Transformer Architectures
  13. OpenAI’s Generative Pretrained Transformers
  14. GPT-4
  15. Google’s Gemini
  16. Meta’s Llama and Open Source
  17. Leveraging Quantization and LoRA
  18. Mistral
  19. Anthropic: Claude
  20. GPT-4V(ision)
  21. Model Comparison
  22. Summary
  23. 3. Standard Practices for Text Generation with ChatGPT
  24. Generating Lists
  25. Hierarchical List Generation
  26. When to Avoid Using Regular Expressions
  27. Generating JSON
  28. Filtering YAML Payloads
  29. Handling Invalid Payloads in YAML
  30. Diverse Format Generation with ChatGPT
  31. Explain It like I’m Five
  32. Universal Translation Through LLMs
  33. Ask for Context
  34. Text Style Unbundling
  35. Identifying the Desired Textual Features
  36. Generating New Content with the Extracted Features
  37. Extracting Specific Textual Features with LLMs
  38. Summarization
  39. Summarizing Given Context Window Limitations
  40. Chunking Text
  41. Chunking Strategies
  42. Sentence Detection Using SpaCy
  43. Building a Simple Chunking Algorithm in Python
  44. Sliding Window Chunking
  45. Text Chunking Packages
  46. Text Chunking with Tiktoken
  47. Encodings
  48. Estimating Token Usage for Chat API Calls
  49. Sentiment Analysis
  50. Least to Most
  51. Role Prompting
  52. Benefits of Role Prompting
  53. Challenges of Role Prompting
  54. When to Use Role Prompting
  55. GPT Prompting Tactics
  56. Classification with LLMs
  57. Building a Classification Model
  58. Majority Vote for Classification
  59. Criteria Evaluation
  60. Meta Prompting
  61. Summary
  62. 4. Advanced Techniques for Text Generation with LangChain
  63. Introduction to LangChain
  64. Chat Models
  65. Streaming Chat Models
  66. Creating Multiple LLM Generations
  67. LangChain Prompt Templates
  68. LangChain Expression Language (LCEL)
  69. Using PromptTemplate with Chat Models
  70. Output Parsers
  71. LangChain Evals
  72. OpenAI Function Calling
  73. Parallel Function Calling
  74. Function Calling in LangChain
  75. Extracting Data with LangChain
  76. Query Planning
  77. Creating Few-Shot Prompt Templates
  78. Limitations with Few-Shot Examples
  79. Saving and Loading LLM Prompts
  80. Data Connection
  81. Document Loaders
  82. Text Splitters
  83. Text Splitting by Length and Token Size
  84. Text Splitting with Recursive Character Splitting
  85. Task Decomposition
  86. Prompt Chaining
  87. Summary
  88. 5. Vector Databases with FAISS and Pinecone
  89. Retrieval Augmented Generation (RAG)
  90. Introducing Embeddings
  91. Document Loading
  92. Memory Retrieval with FAISS
  93. RAG with LangChain
  94. Hosted Vector Databases with Pinecone
  95. Self-Querying
  96. Alternative Retrieval Mechanisms
  97. Summary
  98. 6. Autonomous Agents with Memory and Tools
  99. Chain-of-Thought
  100. Agents
  101. Using LLMs as an API (OpenAI Functions)
  102. Comparing OpenAI Functions and ReAct
  103. Agent Toolkits
  104. Customizing Standard Agents
  105. Custom Agents in LCEL
  106. Understanding and Using Memory
  107. Memory in LangChain
  108. Other Popular Memory Types in LangChain
  109. OpenAI Functions Agent with Memory
  110. Advanced Agent Frameworks
  111. Callbacks
  112. Summary
  113. 7. Introduction to Diffusion Models for Image Generation
  114. OpenAI DALL-E
  115. Midjourney
  116. Stable Diffusion
  117. Google Gemini
  118. Text to Video
  119. Model Comparison
  120. Summary
  121. 8. Standard Practices for Image Generation with Midjourney
  122. Format Modifiers
  123. Art Style Modifiers
  124. Reverse Engineering Prompts
  125. Quality Boosters
  126. Negative Prompts
  127. Weighted Terms
  128. Prompting with an Image
  129. Inpainting
  130. Outpainting
  131. Consistent Characters
  132. Prompt Rewriting
  133. Meme Unbundling
  134. Meme Mapping
  135. Prompt Analysis
  136. Summary
  137. 9. Advanced Techniques for Image Generation with Stable Diffusion
  138. Running Stable Diffusion
  139. AUTOMATIC1111 Web User Interface
  140. Img2Img
  141. Upscaling Images
  142. Interrogate CLIP
  143. SD Inpainting and Outpainting
  144. ControlNet
  145. Segment Anything Model (SAM)
  146. DreamBooth Fine-Tuning
  147. Stable Diffusion XL Refiner
  148. Summary
  149. 10. Building AI-Powered Applications
  150. AI Blog Writing
  151. Topic Research
  152. Expert Interview
  153. Generate Outline
  154. Text Generation
  155. Writing Style
  156. Title Optimization
  157. AI Blog Images
  158. User Interface
  159. Summary
  160. Index
书名:生成式AI的提示工程(影印版)
国内出版社:东南大学出版社
出版时间:2025年02月
页数:401
书号:978-7-5766-1763-4
原版书书名:Prompt Engineering for Generative AI
原版书出版商:O'Reilly Media
James Phoenix
 
James Phoenix曾为General Assembly执教60多个数据科学训练营。
 
 
Mike Taylor
 
Mike Taylor创立了营销机构Ladder,在美国、英国、欧盟拥有50名员工。
 
 
The animal on the cover of Prompt Engineering for Generative AI is a screaming hairy armadillo (Chaetophractus vellerosus). This species of armadillo gets it name due to its habit of squealing, or screaming, when it is handled or threatened.
The screaming hairy armadillo resides in arid areas, specifically in regions in Argentina, Bolivia, and Paraguay. This animal prefers subtropical or tropical regions such as dry forests, scrubland, grassland, and deserts. White and light brown hair cover the animal’s limbs and belly. A caparace, a thick armor made of keratin, covers the animal’s body, a shield covers its head, and a small band exists between its ears. The animal typically reaches 12 to 22 inches in length, including its tail, and weighs less than 2 pounds, with male armadillos generally being larger than females.
The screaming hairy armadillo is an omnivore, eating small vertebrates such as frogs, toads, lizards, birds, and rodents, as well as fruits and vegetation. It can go long periods of time without drinking water.
Although the IUCN Red List designates the screaming hairy armadillo as Least Concern, it is heavily hunted in parts of Bolivia for its meat and carapace.
购买选项
定价:188.00元
书号:978-7-5766-1763-4
出版社:东南大学出版社