-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 tracebacks for failed events (#43)
* added failstrings to events * added api key checker * update tox * added daemon * revert test * added fail agent for mock testing * fix typo
- Loading branch information
Showing
5 changed files
with
55 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import agentops | ||
import time | ||
import asyncio | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
|
||
|
||
print('init') | ||
|
||
ao_client = agentops.Client(tags=['mock tests']) | ||
|
||
|
||
@ao_client.record_action('fail') | ||
def fail_func(sleep): | ||
time.sleep(sleep) | ||
print('sync sleep') | ||
|
||
print(1/0) | ||
|
||
|
||
@ao_client.record_action('sleep') | ||
def sleep_func(sleep): | ||
time.sleep(sleep) | ||
print('sync sleep') | ||
|
||
|
||
async def main(): | ||
|
||
print('Action 1') | ||
sleep_func(0.1) | ||
fail_func(0.1) | ||
|
||
ao_client.end_session(end_state='Success') | ||
|
||
|
||
if __name__ == '__main__': | ||
asyncio.run(main()) | ||
print('done') |
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