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

Refined cookbook #45

Merged
merged 124 commits into from
Nov 19, 2024
Merged

Refined cookbook #45

merged 124 commits into from
Nov 19, 2024

Conversation

epec254
Copy link
Collaborator

@epec254 epec254 commented Nov 18, 2024

Related Issues/PRs

#xxx

What changes are proposed in this pull request?

OpenAI SDK based Tool-calling Agent with UC Tool + Vector Search tool
OpenAI SDK based Multi-Agent Supervisor
Genie API PyFunc wrapper

How is this PR tested?

epec254 and others added 30 commits September 27, 2024 16:00
Signed-off-by: Sid Murching <[email protected]>
Signed-off-by: Sid Murching <[email protected]>
Signed-off-by: Sid Murching <[email protected]>
1) Dogfood seems to have an issue where tool calling is returning a nonexistent function name. See trace in https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/2948323364468680?o=6051921418418893#command/397386389372146
2) For RAG only agent, getting 'AttributeError: 'LLMConfig' object has no attribute 'tools'' because RAG agent config object doesn't have a tools field. See https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/2948323364468746?o=6051921418418893#command/397386389372955

Signed-off-by: Sid Murching <[email protected]>
Signed-off-by: Sid Murching <[email protected]>
@epec254 epec254 requested a review from smurching November 19, 2024 03:32
Copy link
Collaborator

@smurching smurching left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to merge and iterate on, thanks @epec254 !

@epec254 epec254 merged commit c3f12c7 into main Nov 19, 2024
0 of 2 checks passed
fflory pushed a commit to fflory/genai-cookbook that referenced this pull request Dec 12, 2024
* Agent config

* Global config

* Global config

* Data pipeline v1

* Eric's updates to refine cookbook

* Move function calling agent config into its own folder

* RAG Only agent

* config folder

* remove eric hardcoded vs endpoint

* respect token config in data pipeline

* Configs to a single cell

* Fix print of config

* Speed up parsing by caching the parsed table

* Fix error handling in create VS index

* REmove debug code

* Clean up uses new cookbook config

* Refactor the agent notebooks

* REmove extra init

* fix data pipeline mlflow tag

* Default to llama

* Improve debug of failed records

* Add debug code

* Simplifications

Signed-off-by: Sid Murching <[email protected]>

* WIP updates, made it partway through agent notebooks

Signed-off-by: Sid Murching <[email protected]>

* WIP debugging the function_calling_agent_mlflow_sdk.py

Signed-off-by: Sid Murching <[email protected]>

* WIP. Current state:
1) Dogfood seems to have an issue where tool calling is returning a nonexistent function name. See trace in https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/2948323364468680?o=6051921418418893#command/397386389372146
2) For RAG only agent, getting 'AttributeError: 'LLMConfig' object has no attribute 'tools'' because RAG agent config object doesn't have a tools field. See https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/2948323364468746?o=6051921418418893#command/397386389372955

Signed-off-by: Sid Murching <[email protected]>

* WIP

Signed-off-by: Sid Murching <[email protected]>

* WIP updating pydantic config structure

Signed-off-by: Sid Murching <[email protected]>

* More progress. Remaining issues:
* utils modules are not importable when agent notebooks are run directly
* Need to fix logging util
* Autologged traces and manual traces in langchain don't interleave properly

Signed-off-by: Sid Murching <[email protected]>

* WIP

Signed-off-by: Sid Murching <[email protected]>

* WIP, more progress, remaining items:
* Restore ModelConfig across examples
* Switch back to OAI SDK
* Document tools class

Signed-off-by: Sid Murching <[email protected]>

* WIP, moving away from ModelConfig due to several devex issues

Signed-off-by: Sid Murching <[email protected]>

* WIP, got most of the code to work

Signed-off-by: Sid Murching <[email protected]>

* Clean up traces for langchain

Signed-off-by: Sid Murching <[email protected]>

* Update documentation

Signed-off-by: Sid Murching <[email protected]>

* Switch back to printing doc string, since it's cleaner than help()

Signed-off-by: Sid Murching <[email protected]>

* Data pipeline - refactor all utils for ease of use & ability to run in local IDE.

* Update git ignore

* locally tested tool code

* working func call agent

* remove mlflow agent

* databricks utils

* data pipeline bugs + switch to content from doc_content

* working data pipeline (except for install of utils)

* refactor agent configs to make room for genie

* removed unused code

* Genie agent

* commit for serializable model with all the old code in comments (just in case)

* remove old code from serializable model

* shared config loader

* ignore tmp configs

* tmp config readme

* initial multi agent

* multi agent works w/ function calling not tested with genie

* datapipline configs suport serializedmodel

* all agents work locally

* clean up

* add UC tool

* part 1 refactor

* tools refactor pt 2

* make function call agent work with new dirs

* agent logging works

* add tmp files to see full diff

* fc agent actually works, remove dead code agent that wasnt refactored

* rename fc agent

* rename mutli agent

* rename common to shared in agents

* move config base to __init__

* move get_current_user_info to db utils

* missing imports

* mutli agent works locally

* fix bug where is the fc agent is called by supervisor directly after another agent, it switched the last message from role=assistant to role=user

* local funcs work

* multi agent refactor for better trace & ease of understanding

* mlflow traces show supervisor COT

* improve mlflow traces

* print response vs messages info

* bug fixes in agent supervisor

* local func tracing + dict for uc tool result

* uc tool parsing code for spark exceptions

* uc tool is pytest-able

* sample sku tool works

* refactor stragglers

* fc test code

* remove rag only agent

* simplify errors

* sku translator sample tests

* tools nb

* temp nbs

* pytest

* tests for sample tools

* sample code exec tool

* data pipeline config dumps the actual uc locations

* fix set_model

* remove dependency on index's source table in vector search tool

* remove commented out code

* fix set_model and debug

* load_config  refactor

* Tools creation notebook

* Genie agent uses new config loader

* multi agent supervisor works locally

* Tool calling agent

* multi agent

* clear data pipeline outputs

* read me updates

* Multi-agent works with endpoint

* tool calling agent nb

* load config doc string

* update noteboks

* update gitignnore

* clean up readme

* remove dead code

* clean up readme

* move new openai sdk to seperate folder

* restore existing agent code

* mlflow tracing disabled hacks

* sample tools

* notebook tweaks

* load_config tweaks

* poetry env

* Tools deployment works

* Deployment logic same on all agents

---------

Signed-off-by: Sid Murching <[email protected]>
Co-authored-by: epec254 <epec254>
Co-authored-by: Sid Murching <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants