Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standard environment variable loading and API key configuration s… #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# cp .env.example .env
# Edit your .env file with your own values
# Don't commit your .env file to git/push to GitHub!
# Don't modify/delete .env.example unless adding extensions to the project
# which require new variable to be added to the .env file

# API CONFIG
OPENAI_API_KEY=
OPENAI_API_MODEL=gpt-3.5-turbo # alternatively, gpt-4, text-davinci-003, etc
OPENAI_TEMPERATURE=0.0
PINECONE_API_KEY=
PINECONE_ENVIRONMENT=

SERPAPI_API_KEY=
ZAPIER_NLA_API_KEY=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ ENV/
env.bak/
venv.bak/

# PyCharm or anyother jetbrain IDE
.idea

# Spyder project settings
.spyderproject
.spyproject
Expand Down
58 changes: 29 additions & 29 deletions LangChain Cookbook Part 1 - Fundamentals.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1407,19 +1407,19 @@
"text": [
"\n",
"\n",
"\u001b[1m> Entering new SimpleSequentialChain chain...\u001b[0m\n",
"\u001b[36;1m\u001b[1;3mA classic dish from Rome is Spaghetti alla Carbonara. This dish is a creamy pasta made with eggs, cured pork, Pecorino Romano cheese, black pepper, and Olive oil.\u001b[0m\n",
"\u001b[33;1m\u001b[1;3m1. Bring a large pot of salted water to a boil.\n",
"\u001B[1m> Entering new SimpleSequentialChain chain...\u001B[0m\n",
"\u001B[36;1m\u001B[1;3mA classic dish from Rome is Spaghetti alla Carbonara. This dish is a creamy pasta made with eggs, cured pork, Pecorino Romano cheese, black pepper, and Olive oil.\u001B[0m\n",
"\u001B[33;1m\u001B[1;3m1. Bring a large pot of salted water to a boil.\n",
"2. Add about a pound of spaghetti noodles and cook for 8-10 minutes, stirring occasionally.\n",
"3. Drain noodles and set aside.\n",
"4. In a separate bowl, whisk together 2 eggs and ½ cup of Pecorino Romano cheese.\n",
"5. In a large skillet, heat 2 tablespoons of olive oil over medium heat.\n",
"6. Add 4 ounces of cubed pancetta or guanciale and cook until lightly browned, stirring often.\n",
"7. Reduce heat to low and add the spaghetti noodles.\n",
"8. Pour the egg mixture over the noodles and vigorously stir together.\n",
"9. Remove from heat, stir in a pinch of black pepper and serve.\u001b[0m\n",
"9. Remove from heat, stir in a pinch of black pepper and serve.\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n"
"\u001B[1m> Finished chain.\u001B[0m\n"
]
}
],
Expand Down Expand Up @@ -1449,12 +1449,12 @@
"text": [
"\n",
"\n",
"\u001b[1m> Entering new MapReduceDocumentsChain chain...\u001b[0m\n",
"\u001B[1m> Entering new MapReduceDocumentsChain chain...\u001B[0m\n",
"\n",
"\n",
"\u001b[1m> Entering new LLMChain chain...\u001b[0m\n",
"\u001B[1m> Entering new LLMChain chain...\u001B[0m\n",
"Prompt after formatting:\n",
"\u001b[32;1m\u001b[1;3mWrite a concise summary of the following:\n",
"\u001B[32;1m\u001B[1;3mWrite a concise summary of the following:\n",
"\n",
"\n",
"\"January 2017Because biographies of famous scientists tend to \n",
Expand All @@ -1472,9 +1472,9 @@
"crazy.But maybe there is a simpler explanation. Maybe\"\n",
"\n",
"\n",
"CONCISE SUMMARY:\u001b[0m\n",
"CONCISE SUMMARY:\u001B[0m\n",
"Prompt after formatting:\n",
"\u001b[32;1m\u001b[1;3mWrite a concise summary of the following:\n",
"\u001B[32;1m\u001B[1;3mWrite a concise summary of the following:\n",
"\n",
"\n",
"\"the smartness and the craziness were not as separate\n",
Expand All @@ -1491,31 +1491,31 @@
"they were all risky.\"\n",
"\n",
"\n",
"CONCISE SUMMARY:\u001b[0m\n",
"CONCISE SUMMARY:\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n",
"\u001B[1m> Finished chain.\u001B[0m\n",
"\n",
"\n",
"\u001b[1m> Entering new StuffDocumentsChain chain...\u001b[0m\n",
"\u001B[1m> Entering new StuffDocumentsChain chain...\u001B[0m\n",
"\n",
"\n",
"\u001b[1m> Entering new LLMChain chain...\u001b[0m\n",
"\u001B[1m> Entering new LLMChain chain...\u001B[0m\n",
"Prompt after formatting:\n",
"\u001b[32;1m\u001b[1;3mWrite a concise summary of the following:\n",
"\u001B[32;1m\u001B[1;3mWrite a concise summary of the following:\n",
"\n",
"\n",
"\" Biographies of famous scientists fail to show the risks they took and the mistakes they made, leading to an unbalanced impression. Explaining the detours taken in their exploration of topics such as alchemy and theology, smart people are often thought of as crazy; however, there may be a simpler explanation.\n",
"\n",
" In Newton's day, no one knew how successful inventing physics, alchemy, and theology would be. But Newton made the decision to pursue all three topics, and one of them was a success. Even though our current view is that physics is the superior venture and alchemy and theology are waste of time, Newton's risky decision shows that these things were once considered equally important.\"\n",
"\n",
"\n",
"CONCISE SUMMARY:\u001b[0m\n",
"CONCISE SUMMARY:\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n",
"\u001B[1m> Finished chain.\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n",
"\u001B[1m> Finished chain.\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n"
"\u001B[1m> Finished chain.\u001B[0m\n"
]
},
{
Expand Down Expand Up @@ -1657,19 +1657,19 @@
"text": [
"\n",
"\n",
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
"\u001b[32;1m\u001b[1;3m I should try to find out what band Natalie Bergman is a part of.\n",
"\u001B[1m> Entering new AgentExecutor chain...\u001B[0m\n",
"\u001B[32;1m\u001B[1;3m I should try to find out what band Natalie Bergman is a part of.\n",
"Action: Search\n",
"Action Input: \"Natalie Bergman band\"\u001b[0m\n",
"Observation: \u001b[36;1m\u001b[1;3mNatalie Bergman is an American singer-songwriter. She is one half of the duo Wild Belle, along with her brother Elliot Bergman. Her debut solo album, Mercy, was released on Third Man Records on May 7, 2021. She is based in Los Angeles.\u001b[0m\n",
"Thought:\u001b[32;1m\u001b[1;3m I should search for the debut album of Wild Belle.\n",
"Action Input: \"Natalie Bergman band\"\u001B[0m\n",
"Observation: \u001B[36;1m\u001B[1;3mNatalie Bergman is an American singer-songwriter. She is one half of the duo Wild Belle, along with her brother Elliot Bergman. Her debut solo album, Mercy, was released on Third Man Records on May 7, 2021. She is based in Los Angeles.\u001B[0m\n",
"Thought:\u001B[32;1m\u001B[1;3m I should search for the debut album of Wild Belle.\n",
"Action: Search\n",
"Action Input: \"Wild Belle debut album\"\u001b[0m\n",
"Observation: \u001b[36;1m\u001b[1;3mIsles\u001b[0m\n",
"Thought:\u001b[32;1m\u001b[1;3m I now know the final answer.\n",
"Final Answer: Isles is the debut album of Wild Belle, the band that Natalie Bergman is a part of.\u001b[0m\n",
"Action Input: \"Wild Belle debut album\"\u001B[0m\n",
"Observation: \u001B[36;1m\u001B[1;3mIsles\u001B[0m\n",
"Thought:\u001B[32;1m\u001B[1;3m I now know the final answer.\n",
"Final Answer: Isles is the debut album of Wild Belle, the band that Natalie Bergman is a part of.\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n"
"\u001B[1m> Finished chain.\u001B[0m\n"
]
}
],
Expand Down
Loading