Spaces:
Runtime error
Runtime error
I don't understand how to run your code on a computer.
#2
by
Emil-Zakirov
- opened
[[Example:
import os
import json
import sys
import ai_agents
Path to the configuration file
config_path = r "C:\Users\User\User\Desktop\My_projects\GoogleSpreadsheets_generator\Agents\config.json"
Load the configuration file
with open(config_path, "r") as config_file:
config = json.load(config_file)
Set environment variables
os.environ["API_KEY"] = config["API_KEY"]
os.environ["PROXY"] = config["PROXY"]
os.environ["MAX_CHAT_HISTORY"] = config["MAX_CHAT_HISTORY"]
os.environ["User_Names"] = json.dumps(config["User_Names"])
If you are using WebSearchComponent, set this environment variable
If "WebSearchComponent" in config:
os.environ["WebSearchComponent"] = json.dumps(config["WebSearchComponent"])
Start a multi-agent system
ai_agents(agent=config_path)