Patrefans
echohive42 from patreon
echohive42 patreon

Custom Langchain agent/tools with memory video code file:

🕑 Added 2023-02-15 13:48:25 +0000 UTC

Comments

Echo Hive

Sorry for the late reply. I must have missed this one. It automatically reads the API key from a user environment variable named as "OPENAI_API_KEY" if you have that setup, then you are good to go. Otherwise you would have to explicitly define it.

Jim McMillan

Help me understand how this is connecting to OpenAI API? I don't see the call from the code. Is it pulling my API key from the environment or do I not need one? Great work. Thank you.

Echo Hive

I haven’t tried with lambda but you can load those built in tools easily with load_tools import from langchain as such: tools = load_tools(["serpapi", "llm-math", "wolfram-alpha"], llm=llm, serpapi_api_key=os.getenv("SERPAPI_API_KEY"), wolfram_alpha_appid=os.getenv("WOLFRAM_ALPHA_APPID"). It is in the code from “gpt-3 searches the internet” post and video

Mark

Thanks for making this great video. Question, have you tried using the lambda function to import the tools i.e wolframalpha? See below. func=lambda llm, serpapi_api_key, wolfram_alpha_appid: load_tools(["serpapi", "wolfram-alpha"], llm=llm, serpapi_api_key=serpapi_api_key, wolfram_alpha_appid=wolfram_alpha_appid)


More Creators