-
Notifications
You must be signed in to change notification settings - Fork 809
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
Showing
8 changed files
with
65 additions
and
40 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
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
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
from .abstract_tracker import AbstractTracker | ||
from .langfuse_tracker import LangfuseUsageTracker | ||
from .sqlite_tracker import SQLiteUsageTracker | ||
from .tracker_factory import get_tracker_by_name | ||
|
||
__all__ = [ | ||
"AbstractTracker", | ||
"SQLiteUsageTracker", | ||
"LangfuseUsageTracker", | ||
"get_tracker_by_name", | ||
] |
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,43 @@ | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
|
||
from agency_swarm import Agency, Agent | ||
from agency_swarm.util.oai import _get_openai_module, set_tracker | ||
|
||
# Test Langfuse configuration | ||
set_tracker("langfuse") | ||
openai = _get_openai_module() | ||
openai.langfuse_auth_check() | ||
|
||
# Create multiple agents with different roles | ||
manager = Agent( | ||
name="Project Manager", | ||
description="Manages projects and coordinates between team members", | ||
temperature=0.5, | ||
) | ||
|
||
developer = Agent( | ||
name="Developer", | ||
description="Implements technical solutions and writes code", | ||
temperature=0.7, | ||
) | ||
|
||
analyst = Agent( | ||
name="Data Analyst", | ||
description="Analyzes data and provides insights", | ||
temperature=0.4, | ||
) | ||
|
||
# Create agency with communication flows | ||
agency = Agency( | ||
[ | ||
manager, # Manager is the entry point | ||
[manager, developer], # Manager can communicate with Developer | ||
[manager, analyst], # Manager can communicate with Analyst | ||
[developer, analyst], # Developer can communicate with Analyst | ||
] | ||
) | ||
|
||
# Run the demo with Gradio interface | ||
agency.demo_gradio() |
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