Skip to content

Commit

Permalink
Updated URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
daveebbelaar committed Apr 20, 2023
1 parent 18b7563 commit e126913
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ By selling LangChain-based applications as a service to businesses, you can prov
## Requirements

- Python 3.6 or higher
- LangChain library
- OpenAI API key
- [LangChain library](https://python.langchain.com/en/latest/index.html)
- [OpenAI API key](https://platform.openai.com/)
- [SerpAPI API Key](https://serpapi.com/)

## Installation

Expand Down
17 changes: 8 additions & 9 deletions src/getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
load_dotenv(find_dotenv())

# --------------------------------------------------------------
# Models
# LLMs: Get predictions from a language model
# --------------------------------------------------------------

llm = OpenAI(model_name="text-davinci-003")
Expand All @@ -22,39 +22,38 @@


# --------------------------------------------------------------
# Prompts
# Prompt Templates: Manage prompts for LLMs
# --------------------------------------------------------------

prompt = PromptTemplate(
input_variables=["product"],
template="What is a good name for a company that makes {product}?",
)

prompt.format(product="toothbrushes")
prompt.format(product="Smart Apps using Large Language Models (LLMs)")

# --------------------------------------------------------------
# Chains
# Chains: Combine LLMs and prompts in multi-step workflows
# --------------------------------------------------------------

llm = OpenAI(temperature=0.9)
llm = OpenAI(model_name="text-davinci-003")
prompt = PromptTemplate(
input_variables=["product"],
template="What is a good name for a company that makes {product}?",
)

chain = LLMChain(llm=llm, prompt=prompt)

chain.run("AI Aquisition Agents")
chain.run("")

# --------------------------------------------------------------
# Agents
# Agents: Dynamically Call Chains Based on User Input
# --------------------------------------------------------------

# First, let's load the language model we're going to use to control the agent.
llm = OpenAI(temperature=0)

# Next, let's load some tools to use. Note that the `llm-math` tool uses an LLM, so we need to pass that in.
tools = load_tools(["wikipedia", "google-search", "llm-math"], llm=llm)
tools = load_tools(["wikipedia", "serpapi", "llm-math"], llm=llm)
get_all_tool_names()

# Finally, let's initialize an agent with the tools, the language model, and the type of agent we want to use.
Expand Down

0 comments on commit e126913

Please sign in to comment.