Skip to content

Commit 5048479

Browse files
committed
curation
1 parent e51c840 commit 5048479

File tree

5 files changed

+142
-181
lines changed

5 files changed

+142
-181
lines changed

src/examples/crewai_example/simple_agent/main.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import agentops
88

99
load_dotenv()
10-
agentops.init()
11-
langtrace.init(write_spans_to_console=False, batch=False)
10+
langtrace.init()
1211

1312

1413
class PoetryCrew:
@@ -32,15 +31,15 @@ def run(self):
3231
if __name__ == "__main__":
3332
print("## Welcome to Poetry Crew")
3433
print("-------------------------------")
35-
topic = input(
36-
dedent(
37-
"""
38-
What topic do you want to write a poem on?
39-
"""
40-
)
41-
)
42-
43-
poetry_crew = PoetryCrew(topic=topic)
34+
# topic = input(
35+
# dedent(
36+
# """
37+
# What topic do you want to write a poem on?
38+
# """
39+
# )
40+
# )
41+
42+
poetry_crew = PoetryCrew(topic="cold")
4443
result = poetry_crew.run()
4544
print("\n\n########################")
4645
print("## Here is you poem")

src/examples/crewai_example/simple_agent/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ def create_poem(self, agent, topic):
1818
),
1919
expected_output="A creative and expressive poem that captures the essence of the given topic.",
2020
agent=agent,
21+
output_file="poem.txt",
2122
)

src/examples/crewai_example/trip_planner/main.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,36 @@ def run(self):
5959
if __name__ == "__main__":
6060
print("## Welcome to Trip Planner Crew")
6161
print("-------------------------------")
62-
origin = input(
63-
dedent(
64-
"""
65-
From where will you be traveling from?
66-
"""
67-
)
68-
)
69-
cities = input(
70-
dedent(
71-
"""
72-
What are the cities options you are interested in visiting?
73-
"""
74-
)
75-
)
76-
date_range = input(
77-
dedent(
78-
"""
79-
What is the date range you are interested in traveling?
80-
"""
81-
)
82-
)
83-
interests = input(
84-
dedent(
85-
"""
86-
What are some of your high level interests and hobbies?
87-
"""
88-
)
89-
)
62+
# origin = input(
63+
# dedent(
64+
# """
65+
# From where will you be traveling from?
66+
# """
67+
# )
68+
# )
69+
# cities = input(
70+
# dedent(
71+
# """
72+
# What are the cities options you are interested in visiting?
73+
# """
74+
# )
75+
# )
76+
# date_range = input(
77+
# dedent(
78+
# """
79+
# What is the date range you are interested in traveling?
80+
# """
81+
# )
82+
# )
83+
# interests = input(
84+
# dedent(
85+
# """
86+
# What are some of your high level interests and hobbies?
87+
# """
88+
# )
89+
# )
9090

91-
trip_crew = TripCrew(origin, cities, date_range, interests)
91+
trip_crew = TripCrew("cairo", "marsa alam", "sep", "scuba diving")
9292
result = trip_crew.run()
9393
print("\n\n########################")
9494
print("## Here is you Trip Plan")

src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from typing import Collection
2121
from importlib_metadata import version as v
2222
from .patch import patch_crew
23+
import crewai
2324

2425

2526
class CrewAIInstrumentation(BaseInstrumentor):
@@ -46,7 +47,7 @@ def _instrument(self, **kwargs):
4647
)
4748
_W(
4849
"crewai.task",
49-
"Task.execute",
50+
"Task.execute_sync",
5051
patch_crew("Task.execute", version, tracer),
5152
)
5253
except Exception as e:

0 commit comments

Comments
 (0)