facebookresearch / facebookresearch/DocAgent
How to modify code if the API key keeps on changing every half or one hour?
- Dominant language
- Python
- Stars
- 451
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I’m working with a very large codebase and need to create docstrings for it. However, I’m in a highly restricted environment where the OpenAI API key changes frequently. So I am reading the key from a file that keeps changing every 30 minutes. If the code keeps on running and the orchestrator is initialized using the old key, then it errors out. What’s the best way to initialize the orchestrator every 30 minutes so that picks up the new key?
Currently, I’m initializing the orchestrator inside the loop:
for component_id in sorted_component:
# initialize orchestrator here
Will I lose a significant amount of context by reinitializing it for each component_id? I don’t fully understand the code yet, so any guidance would be greatly appreciated.
Thank You
Contributor guide
Assessment
This issue has not been assessed yet.