GenAI with Python: Construct Brokers from Scratch (Full Tutorial) | by Mauro Di Pietro | Sep, 2024

GenAI with Python: Construct Brokers from Scratch (Full Tutorial) | by Mauro Di Pietro | Sep, 2024
GenAI with Python: Construct Brokers from Scratch (Full Tutorial) | by Mauro Di Pietro | Sep, 2024


with Ollama, LangChain, LangGraph (No GPU, No APIKEY)

Photograph by Mathieu Stern on Unsplash

(All pictures are by the writer except in any other case famous)

Intro

Immediate Engineering is the follow of designing and refining prompts (textual content inputs) to reinforce the conduct of Massive Language Models (LLMs). The aim is to get the specified responses from the mannequin by rigorously crafting the directions. Essentially the most used prompting strategies are:

  • Chain-of-Thought: includes producing a step-by-step reasoning course of to achieve a conclusion. The mannequin is pushed to “assume out loud” by explicitly laying out the logical steps that result in the ultimate reply.
  • ReAct (Cause+Act): combines reasoning with motion. The mannequin not solely thinks via an issue but additionally takes actions primarily based on its reasoning. So it’s extra interactive because the mannequin alternates between reasoning steps and actions, refining its strategy iteratively. Mainly, it’s a loop of “thought”, “motion”, “commentary”.

Let’s make an instance: think about asking an AI to “discover the most effective laptop computer below $1000”.

Regular Reply: “Lenovo Thinkpad”.

– Chain-of-Thought Reply: “I want to think about elements like efficiency, battery life, and…

Leave a Reply

Your email address will not be published. Required fields are marked *