Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 165e86a

Browse files
committed
Lint
1 parent 3a56ba5 commit 165e86a

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

agent_humanloop/schedule_agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import asyncio
22
import time
3+
34
from restack_ai import Restack
45

6+
57
async def main():
68

79
client = Restack()
@@ -36,4 +38,4 @@ def run_schedule_workflow():
3638
asyncio.run(main())
3739

3840
if __name__ == "__main__":
39-
run_schedule_workflow()
41+
run_schedule_workflow()

agent_humanloop/src/agents/agent.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
from dataclasses import dataclass
12
from datetime import timedelta
3+
24
from restack_ai.agent import agent, import_functions, log
3-
from dataclasses import dataclass
45

56
with import_functions():
6-
from src.functions.function import feedback as feedback_function, goodbye, InputFeedback
7+
from src.functions.function import InputFeedback, goodbye
8+
from src.functions.function import (
9+
feedback as feedback_function,
10+
)
711

812
@dataclass
913
class Feedback:
@@ -23,7 +27,7 @@ async def event_feedback(self, feedback: Feedback) -> Feedback:
2327
result = await agent.step(function=feedback_function, function_input=InputFeedback(feedback.feedback), start_to_close_timeout=timedelta(seconds=120))
2428
log.info("Received feedback", result=result)
2529
return result
26-
30+
2731
@agent.event
2832
async def event_end(self, end: End) -> End:
2933
log.info("Received end", end=end)

agent_humanloop/src/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import os
2+
3+
from dotenv import load_dotenv
24
from restack_ai import Restack
35
from restack_ai.restack import CloudConnectionOptions
4-
from dotenv import load_dotenv
6+
57
# Load environment variables from a .env file
68
load_dotenv()
79

@@ -17,4 +19,4 @@
1719
api_key=api_key,
1820
api_address=api_address
1921
)
20-
client = Restack(connection_options)
22+
client = Restack(connection_options)

agent_humanloop/src/functions/function.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
from restack_ai.function import function, log
21
from dataclasses import dataclass
2+
3+
from restack_ai.function import function, log
4+
5+
36
@dataclass
47
class InputFeedback:
58
feedback: str
69

710
@function.defn()
811
async def goodbye() -> str:
912
log.info("goodbye function started")
10-
return f"Goodbye!"
13+
return "Goodbye!"
1114

1215
@function.defn()
1316
async def feedback(input: InputFeedback) -> str:

agent_humanloop/src/services.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import asyncio
22
import os
3+
import webbrowser
4+
35
from watchfiles import run_process
4-
from src.functions.function import feedback, goodbye
5-
from src.client import client
6+
67
from src.agents.agent import AgentHumanLoop
7-
import webbrowser
8+
from src.client import client
9+
from src.functions.function import feedback, goodbye
10+
811

912
async def main():
1013

@@ -26,4 +29,4 @@ def watch_services():
2629
run_process(watch_path, recursive=True, target=run_services)
2730

2831
if __name__ == "__main__":
29-
run_services()
32+
run_services()

0 commit comments

Comments
 (0)