-
-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Dec 24, 2023
1 parent
fd58cfa
commit 739125d
Showing
5 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
|
||
from dotenv import load_dotenv | ||
|
||
# Import the OpenAIChat model and the Agent struct | ||
from swarms.models import OpenAIChat | ||
from swarms.structs import Agent | ||
|
||
# Load the environment variables | ||
load_dotenv() | ||
|
||
# Get the API key from the environment | ||
api_key = os.environ.get("OPENAI_API_KEY") | ||
|
||
# Initialize the language model | ||
llm = OpenAIChat( | ||
temperature=0.5, | ||
model_name="gpt-4", | ||
openai_api_key=api_key, | ||
max_tokens=1000, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters