Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f/switch to pg #959

Merged
merged 374 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
374 commits
Select commit Hold shift + click to select a range
32dbbba
fix: Fix return types
whiterabbit1983 Dec 20, 2024
281e1a8
feat: Add update tool query
whiterabbit1983 Dec 20, 2024
93673b7
fix: fixed the CRD doc queries + added tests
Vedantsahai18 Dec 20, 2024
7b0be5c
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 20, 2024
dc0ec36
wip: initial set of exceptions added
Vedantsahai18 Dec 20, 2024
32d67bc
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 20, 2024
831e950
chore: added embedding reading + doctrings updates
Vedantsahai18 Dec 20, 2024
74add36
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 20, 2024
249513d
chore: updated migrations + added indices support
Vedantsahai18 Dec 21, 2024
d7d9cd4
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 21, 2024
3600a92
Merge branch 'f/switch-to-pg' into f/doc-queries
creatorrr Dec 21, 2024
2900786
fix(memory-store): Remove redundant indices
creatorrr Dec 21, 2024
1a0fe16
feat(agents-api, memory-store): Add tasks queries and tests, and othe…
Ahmad-mtos Dec 21, 2024
e18756e
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 21, 2024
76819e1
Merge branch 'f/switch-to-pg' into f/simplify-blob-store
creatorrr Dec 21, 2024
1982583
Merge pull request #977 from julep-ai/f/simplify-blob-store
creatorrr Dec 21, 2024
004461c
Update async_s3.py
creatorrr Dec 21, 2024
b8cf8ce
Merge branch 'f/switch-to-pg' into f/task-queries
whiterabbit1983 Dec 21, 2024
ba86224
Merge pull request #978 from julep-ai/f/task-queries
whiterabbit1983 Dec 21, 2024
c2d54a4
fix: Miscellaneous fixes
creatorrr Dec 21, 2024
6a52a40
WIP
whiterabbit1983 Dec 21, 2024
8db396f
feat: Add executions queries
whiterabbit1983 Dec 21, 2024
65641cb
Merge branch 'f/switch-to-pg' into f/doc-queries
Vedantsahai18 Dec 21, 2024
f80ff87
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 21, 2024
747aceb
fix: Fix search_by_text; remove tools.task_version column
creatorrr Dec 22, 2024
b946119
fix: Fix canonical name collisions in tests
creatorrr Dec 22, 2024
4fc4f0e
refactor: Lint agents-api (CI)
creatorrr Dec 22, 2024
e2181fb
fix: Fix search by embedding
creatorrr Dec 22, 2024
934db8a
refactor: Lint agents-api (CI)
creatorrr Dec 22, 2024
791a8a9
Merge pull request #979 from julep-ai/f/doc-queries
creatorrr Dec 23, 2024
39589d2
wip
Ahmad-mtos Dec 23, 2024
3ae8d9e
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 23, 2024
daa41d6
chore: configure `users` router with pg queries
HamadaSalhab Dec 23, 2024
9b69b06
Merge branch 'f/configure-routers' of https://github.com/julep-ai/jul…
HamadaSalhab Dec 23, 2024
96e9b0e
chore: configure `tasks` router with pg queries
HamadaSalhab Dec 23, 2024
d580873
refactor: Lint agents-api (CI)
HamadaSalhab Dec 23, 2024
14b5761
wip
Ahmad-mtos Dec 23, 2024
bb9dd4a
Merge remote-tracking branch 'origin/f/executions-queries' into f/con…
Ahmad-mtos Dec 23, 2024
9ebd4ef
Merge remote-tracking branch 'origin/f/tools-queries' into f/configur…
Ahmad-mtos Dec 23, 2024
5887e12
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 23, 2024
ebe9922
chore: configure `sessions` router with pg queries
HamadaSalhab Dec 23, 2024
19e96ba
chore: configure `healthz` router with pg queries
HamadaSalhab Dec 23, 2024
d3e8831
chore: configure `files` router with pg queries
HamadaSalhab Dec 23, 2024
9853846
chore: add `executions` pg queries in `tasks` router
HamadaSalhab Dec 23, 2024
e976060
refactor: Lint agents-api (CI)
HamadaSalhab Dec 23, 2024
8d40526
fix(agents-api): Make query functions async
Ahmad-mtos Dec 23, 2024
b339e03
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 23, 2024
14d838d
chore: await asynchronous query functions in all routers
HamadaSalhab Dec 23, 2024
3bc5875
fix(agents-api): await async functions in routers
Ahmad-mtos Dec 23, 2024
969e38c
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 23, 2024
9d0068e
chore: Move ti queries directory
whiterabbit1983 Dec 18, 2024
780100b
feat: Add prepare chat context query
whiterabbit1983 Dec 19, 2024
c9fc757
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 19, 2024
1d2bd9a
feat: Add SQL validation
whiterabbit1983 Dec 19, 2024
1bc8fe3
chore: Import other required queries
whiterabbit1983 Dec 20, 2024
2975407
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 20, 2024
ba3027b
chore: Move queries to another folder
whiterabbit1983 Dec 20, 2024
5c060ac
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 20, 2024
47b7c7e
feat: Add create tools query
whiterabbit1983 Dec 20, 2024
b774589
feat: Add delete tool query
whiterabbit1983 Dec 20, 2024
b2806ac
feat: Add get tool query
whiterabbit1983 Dec 20, 2024
cf184e0
feat: Add list tools query
whiterabbit1983 Dec 20, 2024
53b65a1
feat: Add patch tool query
whiterabbit1983 Dec 20, 2024
3299d54
fix: Fix return types
whiterabbit1983 Dec 20, 2024
5e94d33
feat: Add update tool query
whiterabbit1983 Dec 20, 2024
0252a88
WIP
whiterabbit1983 Dec 21, 2024
d209e77
feat: Add tools args from metadata query
whiterabbit1983 Dec 23, 2024
8b54c80
fix(agents-api): Fix fixtures and initialization for app postgres client
creatorrr Dec 23, 2024
dfa5785
refactor: Lint agents-api (CI)
creatorrr Dec 23, 2024
583bf66
fix: Remove sql validation, fix tests
whiterabbit1983 Dec 23, 2024
128cc2f
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 23, 2024
3d6d023
fix: Fix awaitable and type hint
whiterabbit1983 Dec 23, 2024
1c97bc3
chore: Update type annotations
whiterabbit1983 Dec 23, 2024
358b60b
Merge pull request #982 from julep-ai/f/tools-queries
whiterabbit1983 Dec 23, 2024
60239fd
feat(agents-api): Add routes tests + misc fixes for queries
Ahmad-mtos Dec 23, 2024
5f3adc6
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 23, 2024
830206b
feat(agents-api): added docs hybrid search
Vedantsahai18 Dec 24, 2024
5f4aebc
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 24, 2024
d16a693
chore: skip dearch test + search queries optimized
Vedantsahai18 Dec 24, 2024
23235f4
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 24, 2024
34586d2
Merge pull request #985 from julep-ai/f/dsearch-queries
Vedantsahai18 Dec 24, 2024
6408232
Merge remote-tracking branch 'origin/f/switch-to-pg' into f/configure…
Ahmad-mtos Dec 24, 2024
11734e4
fix(agents-api): fix merge conflicts errors
Ahmad-mtos Dec 24, 2024
e1be81b
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 24, 2024
eadc291
fix(agents-api): Random fixes; make sure content-length is valid
creatorrr Dec 24, 2024
77903ef
refactor: Lint agents-api (CI)
creatorrr Dec 24, 2024
e015a51
Merge pull request #986 from julep-ai/f/configure-routers
Ahmad-mtos Dec 24, 2024
2f836d6
chore(agents-api): remove cozo related stuff
Ahmad-mtos Dec 24, 2024
c53319e
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 24, 2024
c68556f
feat(agents-api): added initial file routes patches for s3
Vedantsahai18 Dec 25, 2024
087a793
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 25, 2024
7913187
fix(agents-api): Fix failing file tests
creatorrr Dec 25, 2024
32dfd5f
chore: minor fix
Vedantsahai18 Dec 25, 2024
c37fcfc
Merge pull request #990 from julep-ai/f/file-routes
Vedantsahai18 Dec 25, 2024
1482eb7
feat: Add executions queries
whiterabbit1983 Dec 24, 2024
fb202c3
fix: Apply small fixes
whiterabbit1983 Dec 24, 2024
224ff5c
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 24, 2024
e929013
feat: Add create execution transition and remove update execution que…
whiterabbit1983 Dec 25, 2024
b766057
fix: Remove invalid import
whiterabbit1983 Dec 25, 2024
0a87266
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 25, 2024
13e4629
fix: Revert create execution
whiterabbit1983 Dec 25, 2024
ffc131b
fix: Add error handling
whiterabbit1983 Dec 25, 2024
9f20476
fix: Apply small fixes
whiterabbit1983 Dec 25, 2024
b24e4a6
fix: Fix test
whiterabbit1983 Dec 25, 2024
98d763b
fix: Fix query variables
whiterabbit1983 Dec 25, 2024
7ed5fda
fix: Fix query
whiterabbit1983 Dec 25, 2024
651c798
fix(agents-api): Fix tools tests
HamadaSalhab Dec 25, 2024
45dad2a
refactor: Lint agents-api (CI)
HamadaSalhab Dec 25, 2024
fb8d97f
fix(agents-api): Fix Tasks test
HamadaSalhab Dec 25, 2024
19d949f
Merge branch 'x/fix-tools-tests' of https://github.com/julep-ai/julep…
HamadaSalhab Dec 25, 2024
2e96022
refactor: Lint agents-api (CI)
HamadaSalhab Dec 25, 2024
ce47442
fix: Fix results mappings
whiterabbit1983 Dec 25, 2024
6646882
Merge pull request #992 from julep-ai/x/fix-tools-tests
Ahmad-mtos Dec 25, 2024
857bb96
Merge pull request #988 from julep-ai/f/executions-queries
Ahmad-mtos Dec 25, 2024
7ab2bb1
Merge branch 'f/switch-to-pg' into f/migrate-workflows-to-pg
Ahmad-mtos Dec 25, 2024
7798826
chore: remove cozo completely, and integrate postgres
Ahmad-mtos Dec 25, 2024
c0acb49
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 25, 2024
3caf682
Merge pull request #989 from julep-ai/f/migrate-workflows-to-pg
Ahmad-mtos Dec 25, 2024
eaada88
chore: misc refactor + fixed list file route test
Vedantsahai18 Dec 25, 2024
88ca072
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 25, 2024
6a5fe63
chore: misc checks
Vedantsahai18 Dec 25, 2024
e155bb5
fix(agents-api): Fix update task query
Ahmad-mtos Dec 26, 2024
d5a9106
fix(migrations): Fix latest_executions not working for zero transitions
creatorrr Dec 26, 2024
f0deed9
fix(agents-api): Update TODO stuff
creatorrr Dec 26, 2024
0991b4c
fix: Fix migration
whiterabbit1983 Dec 26, 2024
594891a
fix: Remove unused parameters and fix queries
whiterabbit1983 Dec 26, 2024
4780439
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 26, 2024
9eff86e
fix: Fix list transitions query
whiterabbit1983 Dec 26, 2024
b115cab
fix: Fix list executions transitions query and add a test
whiterabbit1983 Dec 26, 2024
268fd3f
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 26, 2024
e962645
fix: Use transitions table
whiterabbit1983 Dec 26, 2024
4e1c975
Merge pull request #993 from julep-ai/f/executions-queries
whiterabbit1983 Dec 26, 2024
f4d449b
fix(agents-api): resolve conflicts
Ahmad-mtos Dec 26, 2024
b87f1f8
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 26, 2024
cde3773
fix(agents-api): Fixed create update queries and get task
Ahmad-mtos Dec 26, 2024
31ca260
misc
Ahmad-mtos Dec 26, 2024
3b188f3
refactor: Lint agents-api (CI)
Ahmad-mtos Dec 26, 2024
c038e97
fix(agents-api): Fix failing tests
creatorrr Dec 26, 2024
7011246
refactor: Lint agents-api (CI)
creatorrr Dec 26, 2024
15f5a89
fix(agents-api): Ghost in the machine
creatorrr Dec 26, 2024
798c625
refactor: Lint agents-api (CI)
creatorrr Dec 26, 2024
35344f1
fix(agents-api): fix get task query
Ahmad-mtos Dec 26, 2024
b5a8313
fix(agents-api): add agents_api_transitions to docker compose
Ahmad-mtos Dec 26, 2024
9b9bd73
Merge pull request #994 from julep-ai/x/fix-temporal-workflows
whiterabbit1983 Dec 26, 2024
59d3487
chore(agents-api): Remove tools from default system message
HamadaSalhab Dec 26, 2024
718d612
chore(agents-api): Swap `situation` and `system_template` values in `…
HamadaSalhab Dec 26, 2024
23de839
fix(agents-api): Misc fixes for chat endpoint
HamadaSalhab Dec 27, 2024
40c1a82
refactor: Lint agents-api (CI)
HamadaSalhab Dec 27, 2024
9e82981
Remove `sqlglot`
HamadaSalhab Dec 27, 2024
97982b6
Merge pull request #996 from julep-ai/c/session-situation-system-temp…
HamadaSalhab Dec 27, 2024
bf6f4d7
fix: fixed execution queries test
Vedantsahai18 Dec 27, 2024
fbb33c4
fix(agents-api): Fix tests for workflows
creatorrr Dec 27, 2024
d2cf26c
Merge pull request #998 from julep-ai/x/fix-test-workflow
whiterabbit1983 Dec 27, 2024
a3b8ec9
fix: Fix get task
whiterabbit1983 Dec 26, 2024
4824818
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 26, 2024
29aaf9a
chore: Re-activate tests, apply small fixes along the way
whiterabbit1983 Dec 26, 2024
e511078
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 26, 2024
b748469
fix: Await create pool
whiterabbit1983 Dec 27, 2024
742b1ef
fix: Apply various fixes to chat routes
whiterabbit1983 Dec 27, 2024
06fda32
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 27, 2024
88ba8bc
chore: Remove extra safety
whiterabbit1983 Dec 27, 2024
35e639c
chore: Set up Go migrate
whiterabbit1983 Dec 27, 2024
5839f6e
chore: Skip all execution workflow tests
whiterabbit1983 Dec 27, 2024
b3ffeaf
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 27, 2024
f06439f
chore: Comment out docs routes tests
whiterabbit1983 Dec 27, 2024
fece441
chore: Unskip tests
whiterabbit1983 Dec 27, 2024
ea37837
fix: Apply small fixes to docs logic
whiterabbit1983 Dec 27, 2024
c5377b9
fix: Add exception handling
whiterabbit1983 Dec 27, 2024
f13ab99
fix: Remove assertions
whiterabbit1983 Dec 27, 2024
4a3e14d
refactor: Lint agents-api (CI)
whiterabbit1983 Dec 27, 2024
505a25d
fix(agents-api): Fix tests for workflows
creatorrr Dec 27, 2024
2a186ba
refactor(agents-api): Refactors
creatorrr Dec 27, 2024
33ac790
Merge pull request #995 from julep-ai/x/fix-tests
creatorrr Dec 27, 2024
2e05474
Make `tool_calls` nullable in `entries` table
HamadaSalhab Dec 28, 2024
9a932ae
Fix: Storing `tool_calls` in `entries` relation properly
HamadaSalhab Dec 28, 2024
2a63876
Fix: Remove alien attribute
HamadaSalhab Dec 28, 2024
ff8e9bd
Fix: Wrong await usage
HamadaSalhab Dec 28, 2024
61c8edb
Fix: dump `recall_options` for serialization purpose
HamadaSalhab Dec 28, 2024
ba4b802
Refactor transform function
HamadaSalhab Dec 28, 2024
cde3e08
Fix docs retreival/search errors
HamadaSalhab Dec 28, 2024
53dcbe4
Fix: Adjust to new function parameters
HamadaSalhab Dec 28, 2024
ed2c342
refactor: Lint agents-api (CI)
HamadaSalhab Dec 28, 2024
4fe4b6c
chore: misc test and queries fixes
Vedantsahai18 Dec 28, 2024
f2b3039
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 28, 2024
2fb9970
chore: misc task route fixes
Vedantsahai18 Dec 28, 2024
27e3a08
fix: health route fix
Vedantsahai18 Dec 28, 2024
213807a
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 28, 2024
81841e4
Merge pull request #1001 from julep-ai/x/misc-test-fixes
creatorrr Dec 31, 2024
7f76bc3
Merge branch 'f/switch-to-pg' into x/misc-session-fixes
creatorrr Dec 31, 2024
a5f00b1
Merge pull request #1000 from julep-ai/x/misc-session-fixes
creatorrr Dec 31, 2024
b82e01d
refactor: Lint agents-api (CI)
creatorrr Dec 31, 2024
13088ea
feat(agents-api): Add an extract_json() custom function
Vedantsahai18 Dec 31, 2024
e03b16e
chore: typo fix
Vedantsahai18 Dec 31, 2024
2da2c39
refactor: Lint agents-api (CI)
Vedantsahai18 Dec 31, 2024
f282a85
chore: Remove non-relevant tests
whiterabbit1983 Jan 2, 2025
9cffe68
chore: check for JSON code markers
Vedantsahai18 Jan 2, 2025
7a779db
feat(agents-api): add sessions routes tests
Ahmad-mtos Jan 2, 2025
14b6ec3
refactor: Lint agents-api (CI)
Ahmad-mtos Jan 2, 2025
093c4fe
Merge pull request #1003 from julep-ai/f/extract_json
creatorrr Jan 2, 2025
22caed8
Merge branch 'f/switch-to-pg' into c/remove-non-relevant-tests
creatorrr Jan 2, 2025
439f27b
Merge branch 'f/switch-to-pg' into f/session-routes-tests
creatorrr Jan 2, 2025
af37fb7
Merge pull request #1004 from julep-ai/c/remove-non-relevant-tests
creatorrr Jan 2, 2025
1c3a959
Merge branch 'f/switch-to-pg' into f/session-routes-tests
creatorrr Jan 2, 2025
46db771
Merge pull request #1005 from julep-ai/f/session-routes-tests
creatorrr Jan 2, 2025
ed91d84
fix: Set inherit_tools to true
whiterabbit1983 Jan 2, 2025
3d333a8
fix(agents-api): Fix suite
HamadaSalhab Jan 2, 2025
37f23df
Explain failing task route test
HamadaSalhab Jan 2, 2025
fd3bc23
Merge pull request #1007 from julep-ai/x/test-workflow-routes-suite
HamadaSalhab Jan 2, 2025
3fa2272
Merge pull request #1006 from julep-ai/x/execution-workflow-fix
whiterabbit1983 Jan 2, 2025
38b4acb
fix(agents-api,memory-store): Fix docs tests and related migration
creatorrr Jan 2, 2025
77ebcb9
Merge pull request #1008 from julep-ai/x/fix-docs-tests
creatorrr Jan 2, 2025
7c4db02
fix(agents-api): fix tool fetching in get_task query
Ahmad-mtos Jan 2, 2025
d6db947
fix(agents-api): fix handeling settings as None in ``prompt_step``
Ahmad-mtos Jan 2, 2025
4d9f18d
fix(agents-api): fix reduce call in utils
Vedantsahai18 Jan 2, 2025
9b395f2
refactor: Lint agents-api (CI)
Vedantsahai18 Jan 2, 2025
20a68bf
Merge pull request #1009 from julep-ai/x/execution-workflow-tests
Vedantsahai18 Jan 2, 2025
e16b27d
chore: misc fixes
Vedantsahai18 Jan 2, 2025
3582706
refactor: Lint agents-api (CI)
Vedantsahai18 Jan 2, 2025
e673da0
merge: merged dev to switch-to-pg
Vedantsahai18 Jan 2, 2025
7680d3e
fix(agents-api): Remove unnecessary assert in `test_chat_routes`
HamadaSalhab Jan 2, 2025
afb0620
chore(agents-api): Embed query only if search mode is not text
HamadaSalhab Jan 2, 2025
f6ca349
chore(integrations): Allow spider response content to be a list
HamadaSalhab Jan 2, 2025
f68a19d
fix(agents-api): Fix embedding dimensions issue
HamadaSalhab Jan 2, 2025
1ccd8a7
fix(agents-api): Store `tool_calls` into `entries` properly
HamadaSalhab Jan 2, 2025
900cca8
fix(agents-api,memory-store): Fix docs tests and some migrations
creatorrr Jan 3, 2025
4a2e183
Merge branch 'f/switch-to-pg' into x/fix-docs-tests
creatorrr Jan 3, 2025
7da3641
chore: merge dev to f/switch-to-pg
Ahmad-mtos Jan 3, 2025
2627e7e
Merge pull request #1011 from julep-ai/x/fix-docs-tests
HamadaSalhab Jan 3, 2025
63894e4
fix(agents-api): fix for counter metric
Vedantsahai18 Jan 3, 2025
c00d08d
feat(agents-api): added mmr to chat
Vedantsahai18 Jan 3, 2025
a38dca1
Update agents-api/agents_api/queries/chat/gather_messages.py
Vedantsahai18 Jan 3, 2025
5608d8e
chore: misc fixes and refactors
Vedantsahai18 Jan 3, 2025
6f1521c
chore(agents-api): misc validations
Vedantsahai18 Jan 3, 2025
9c12ad3
chore: misc refactor
Vedantsahai18 Jan 3, 2025
7412ca2
chore(agents-api): misc fixes + refators
Vedantsahai18 Jan 4, 2025
e92fb4d
refactor: Lint agents-api (CI)
Vedantsahai18 Jan 4, 2025
be69c60
chore(agents-api): fix base_evaluate
Vedantsahai18 Jan 4, 2025
dfc9af3
Merge pull request #1013 from julep-ai/f/add-mmr-pg
HamadaSalhab Jan 4, 2025
d374d59
Merge branch 'dev' into f/switch-to-pg
creatorrr Jan 4, 2025
03ecd21
fix(agents-api): Fix regression from merge conflict
creatorrr Jan 4, 2025
f673b23
fix(tests): fixthe chat route
Vedantsahai18 Jan 4, 2025
2f60f03
fix: Fix handlers calls
whiterabbit1983 Jan 4, 2025
c567cdc
Merge pull request #1014 from julep-ai/x/execute-system
whiterabbit1983 Jan 4, 2025
978bb6c
fix(migrations): Change entries timestamp type
HamadaSalhab Jan 4, 2025
ae7a1b6
fix(agents-api): Fix state's `postgress_pool` issue
HamadaSalhab Jan 4, 2025
5cddb90
fix(agents-api): Fix `embedding` naming inconsistency
HamadaSalhab Jan 4, 2025
a09ad92
refactor: Lint agents-api (CI)
HamadaSalhab Jan 4, 2025
47a9ce4
chore(migrations): Increase agent's `about` length to 5000 chars
HamadaSalhab Jan 4, 2025
be6b292
fix(agents-api): Rename embedding search function parameter
HamadaSalhab Jan 4, 2025
577a808
Merge pull request #1016 from julep-ai/x/misc-fixes
whiterabbit1983 Jan 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/workflows/lint-agents-api-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install Go migrate
uses: jaxxstorm/[email protected]
with: # Grab the latest version
repo: golang-migrate/migrate

- name: Set up python and install dependencies
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-agents-api-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install Go migrate
uses: jaxxstorm/[email protected]
with: # Grab the latest version
repo: golang-migrate/migrate

- name: Set up python and install dependencies
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/typecheck-agents-api-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install Go migrate
uses: jaxxstorm/[email protected]
with: # Grab the latest version
repo: golang-migrate/migrate

- name: Set up python and install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ ngrok*
*/node_modules/
.aider*
.vscode/
schema.sql
1 change: 0 additions & 1 deletion agents-api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Local database files
cozo.db
temporal.db
*.bak
*.dat
Expand Down
2 changes: 1 addition & 1 deletion agents-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ COPY . ./
ENV PYTHONUNBUFFERED=1
ENV GUNICORN_CMD_ARGS="--capture-output --enable-stdio-inheritance"

ENTRYPOINT ["uv", "run", "gunicorn", "agents_api.web:app", "-c", "gunicorn_conf.py"]
ENTRYPOINT ["uv", "run", "--offline", "--no-sync", "gunicorn", "agents_api.web:app", "-c", "gunicorn_conf.py"]
22 changes: 0 additions & 22 deletions agents-api/Dockerfile.migration

This file was deleted.

2 changes: 1 addition & 1 deletion agents-api/Dockerfile.worker
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ COPY . ./
ENV PYTHONUNBUFFERED=1
ENV GUNICORN_CMD_ARGS="--capture-output --enable-stdio-inheritance"

ENTRYPOINT ["uv", "run", "python", "-m", "agents_api.worker"]
ENTRYPOINT ["uv", "run", "--offline", "--no-sync", "python", "-m", "agents_api.worker"]
26 changes: 26 additions & 0 deletions agents-api/agents_api/activities/container.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from typing import Any

from aiobotocore.client import AioBaseClient
from asyncpg.pool import Pool


class State:
postgres_pool: Pool | None
s3_client: AioBaseClient | None

def __init__(self):
self.postgres_pool = None
self.s3_client = None

def __setattr__(self, name: str, value: Any) -> None:
super().__setattr__(name, value)


class Container:
state: State

def __init__(self):
self.state = State()


container = Container()
7 changes: 3 additions & 4 deletions agents-api/agents_api/activities/demo.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from typing import Callable

from temporalio import activity

from ..env import testing


async def demo_activity(a: int, b: int) -> int:
# Should throw an error if testing is not enabled
raise Exception("This should not be called in production")
msg = "This should not be called in production"
raise Exception(msg)


async def mock_demo_activity(a: int, b: int) -> int:
return a + b


demo_activity: Callable[[int, int], int] = activity.defn(name="demo_activity")(
demo_activity = activity.defn(name="demo_activity")(
demo_activity if not testing else mock_demo_activity
)
75 changes: 0 additions & 75 deletions agents-api/agents_api/activities/embed_docs.py

This file was deleted.

18 changes: 8 additions & 10 deletions agents-api/agents_api/activities/excecute_api_call.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import base64
from typing import Any, Optional, TypedDict, Union
from typing import Any, TypedDict

import httpx
from beartype import beartype
from temporalio import activity

from ..autogen.openapi_model import ApiCallDef
from ..common.storage_handler import auto_blob_store
from ..env import testing


class RequestArgs(TypedDict):
content: Optional[str]
data: Optional[dict[str, Any]]
json_: Optional[dict[str, Any]]
cookies: Optional[dict[str, str]]
params: Optional[Union[str, dict[str, Any]]]
url: Optional[str]
headers: Optional[dict[str, str]]
content: str | None
data: dict[str, Any] | None
json_: dict[str, Any] | None
cookies: dict[str, str] | None
params: str | dict[str, Any] | None
url: str | None
headers: dict[str, str] | None


@auto_blob_store(deep=True)
@beartype
async def execute_api_call(
api_call: ApiCallDef,
Expand Down
44 changes: 26 additions & 18 deletions agents-api/agents_api/activities/execute_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
from beartype import beartype
from temporalio import activity

from ..app import lifespan
from ..autogen.openapi_model import BaseIntegrationDef
from ..clients import integrations
from ..common.exceptions.tools import IntegrationExecutionException
from ..common.protocol.tasks import ExecutionInput, StepContext
from ..common.storage_handler import auto_blob_store
from ..env import testing
from ..models.tools import get_tool_args_from_metadata
from ..queries import tools
from .container import container


@auto_blob_store(deep=True)
@lifespan(container)
@beartype
async def execute_integration(
context: StepContext,
Expand All @@ -22,23 +23,35 @@ async def execute_integration(
setup: dict[str, Any] = {},
) -> Any:
if not isinstance(context.execution_input, ExecutionInput):
raise TypeError("Expected ExecutionInput type for context.execution_input")
msg = "Expected ExecutionInput type for context.execution_input"
raise TypeError(msg)

developer_id = context.execution_input.developer_id
agent_id = context.execution_input.agent.id

if context.execution_input.task is None:
msg = "Task cannot be None in execution_input"
raise ValueError(msg)

task_id = context.execution_input.task.id

merged_tool_args = get_tool_args_from_metadata(
developer_id=developer_id, agent_id=agent_id, task_id=task_id, arg_type="args"
merged_tool_args = await tools.get_tool_args_from_metadata(
developer_id=developer_id,
agent_id=agent_id,
task_id=task_id,
arg_type="args",
connection_pool=container.state.postgres_pool,
)

merged_tool_setup = get_tool_args_from_metadata(
developer_id=developer_id, agent_id=agent_id, task_id=task_id, arg_type="setup"
merged_tool_setup = await tools.get_tool_args_from_metadata(
developer_id=developer_id,
agent_id=agent_id,
task_id=task_id,
arg_type="setup",
connection_pool=container.state.postgres_pool,
)

arguments = (
merged_tool_args.get(tool_name, {}) | (integration.arguments or {}) | arguments
)
arguments = merged_tool_args.get(tool_name, {}) | (integration.arguments or {}) | arguments

setup = merged_tool_setup.get(tool_name, {}) | (integration.setup or {}) | setup

Expand All @@ -53,10 +66,7 @@ async def execute_integration(
arguments=arguments,
)

if (
"error" in integration_service_response
and integration_service_response["error"]
):
if integration_service_response.get("error"):
raise IntegrationExecutionException(
integration=integration,
error=integration_service_response["error"],
Expand All @@ -69,9 +79,7 @@ async def execute_integration(
integration_str = integration.provider + (
"." + integration.method if integration.method else ""
)
activity.logger.error(
f"Error in execute_integration {integration_str}: {e}"
)
activity.logger.error(f"Error in execute_integration {integration_str}: {e}")

raise

Expand Down
Loading
Loading