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

LLM knowledge retrieval example #201

Merged
merged 3 commits into from
Jun 27, 2023
Merged

LLM knowledge retrieval example #201

merged 3 commits into from
Jun 27, 2023

Conversation

skrawcz
Copy link
Collaborator

@skrawcz skrawcz commented Jun 25, 2023

Reimplements https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_for_knowledge_retrieval.ipynb

This example shows how you can use Hamilton to help create manageable code for creating and dealing
with LLM powered workflows.

Changes

  • adds example

How I tested this

  • ran this locally

Notes

  • Haven't added it to the docs yet.
  • Will squash merge this

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

skrawcz added 2 commits June 24, 2023 23:56
Reimplements https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_for_knowledge_retrieval.ipynb

But I'm going to try to make this more realistic.
TODO:
 - create agent that calls out to Hamilton
 - tidy up code to make it flow better
Run `state.py` for things to be exercised.

Noted pitfalls:
 - no caching
 - some of the state code is poorly constructed in terms of understanding what is being passed around,
doesn't have good annotations, etc.
@skrawcz skrawcz force-pushed the add_llm_kr_example branch from 7f7a168 to 6f49d5f Compare June 26, 2023 06:15
This adds I think the salient points. It needs to be refined more,
but to get something out there, I think this will work.
@skrawcz skrawcz marked this pull request as ready for review June 26, 2023 23:30
@skrawcz skrawcz requested a review from elijahbenizzy June 26, 2023 23:30
@skrawcz skrawcz merged commit b02a028 into main Jun 27, 2023
@skrawcz skrawcz deleted the add_llm_kr_example branch June 27, 2023 05:32
@skrawcz skrawcz changed the title WIP knowledge retrieval example LLM knowledge retrieval example Jun 27, 2023
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.

1 participant