Hi, I am using canopy from a python script, and I am setting the environment variables as mentioned in https://github.com/pinecone-io/canopy/blob/main/examples/canopy-lib-quickstart.ipynb, like:
os.environ[“OPENAI_API_KEY”] = “my-key”
This works, however I cannot set a custom config file like:
os.environ[“CANOPY_CONFIG_FILE”] = “config/custom.yaml”
When I change values inside the file, it does not make any difference. I gave non existing values like gpt-5.5 and it did not show an error either. I tried the same changes with “config/default.yaml” and set os.environ[“CANOPY_CONFIG_FILE”] = “config/default.yaml” and there was no difference here too.
Can anyone help me with this? Thank you!
Hi @gokulsanil.mec and welcome to the Pinecone community forums!
Thank you for your question.
Upon some exploration, it seems like you may need to handle things differently when loading a custom config via Canopy in a Python script:
from canopy.chat_engine import ChatEngine
with open("config/custom.yaml", "r") as f:
config = yaml.safe_load(f)
chat_engine = ChatEngine.from_config(config["chat_engine"])
Try something like this and see if that makes a difference.
It’s possible you’ve found a bug in Canopy, as well, and you might consider filing an issue against GitHub - pinecone-io/canopy: Retrieval Augmented Generation (RAG) framework and context engine powered by Pinecone.
Depending on your use case, you may also be interested to know we now have an Assistant product that allows you to drag and drop your files for instant RAG.