ibm-granite-community / granite-snack-cookbook

Granite Snack Cookbook -- easily consumable recipes (python notebooks) that showcase the capabilities of the Granite models
Creative Commons Attribution 4.0 International
70 stars 17 forks source link

Travel planner agent recipe with granite 3.0 and LangChain Agents #81

Open manojjahgirdar opened 2 weeks ago

manojjahgirdar commented 2 weeks ago

PR Checklist

Model Interaction

Data

Notebook requirements

Incoming References

GitHub

bjhargrave commented 2 weeks ago

The ci build failed with an import error. I think you may be miss installing a needed package.

manojjahgirdar commented 2 weeks ago

Ok let me fix the import statements

manojjahgirdar commented 2 weeks ago

Hi @bjhargrave, I have fixed the import statement, how do I trigger the CI builds?

manojjahgirdar commented 2 weeks ago

It failed again, this time it says WATSONX_URL not found. If you see I have defined it correctly in the notebook.

github-actions[bot] commented 2 weeks ago

Testing Notebooks workflow launched on this PR: View run

bjhargrave commented 2 weeks ago

pull_request workflows do not have access to the secrets. I started a workflow which does.

manojjahgirdar commented 2 weeks ago

@bjhargrave can you rerun the CI pipeline now?

github-actions[bot] commented 2 weeks ago

Testing Notebooks workflow launched on this PR: View run

manojjahgirdar commented 1 week ago

@bjhargrave can you rerun the CI pipeline now?

github-actions[bot] commented 1 week ago

Testing Notebooks workflow launched on this PR: View run

bjhargrave commented 1 week ago

In looking at the code in the notebook, it does not seem to use the Granite 3 prompts for tool use: https://www.ibm.com/granite/docs/models/granite/#tool-usefunction-calling-weather-scenario

It just looks like vanilla langchain tool use.

manojjahgirdar commented 1 week ago

I just referred to the https://github.com/ibm-granite-community/granite-snack-cookbook/blob/main/recipes/AI-Agents/Agentic_RAG.ipynb recipe and tried to solve this new use case. I will try to change the prompt if that is absolutely required.

Changing the prompt may not give desired output, I can still give it a try.

bjhargrave commented 1 week ago

Understood. I am just trying to see if we should, in these Granite recipes, exploit the Granite prompt architecture for things like tool calling. @adampingel Do you have an opinion here? I know that many of the extant recipes were written before Granite 3 was released. But I would think that as we add new recipes, we should lean in to the Granite prompt architecture.

BTW, I have hacked on the existing Function_Calling snack to use the Granite prompt tool calling. I can make a PR for that update soon.

manojjahgirdar commented 13 hours ago

Hi @bjhargrave, I have updated the prompt to use granite 3.0 prompt for tool calling. Can you rerun the pipeline to test it? Thanks.

bjhargrave commented 11 hours ago

You also need to run the pre-commit hooks to clean up the notebook. There is also a readme conflict to resolve.

github-actions[bot] commented 9 hours ago

Testing Notebooks workflow launched on this PR: View run

manojjahgirdar commented 8 hours ago

Ran the pre-commit hook and resolved the readme conflict. Can you run the pipeline once again?

github-actions[bot] commented 8 hours ago

Testing Notebooks workflow launched on this PR: View run