danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
19.37k stars 1.99k forks source link

[Question]: What data is sent to openai? #276

Closed HatBeardMe closed 3 months ago

HatBeardMe commented 4 months ago

What is your question?

I am interested in the summarize_git_changes pattern as highlighted in Daniel's newsletter.

What data is sent back to openai using the gpt-4-turbo API? Is it only the commit messages or also code from the repo related to those commits?

Ex.: git log --pretty=format:"%h - %an, %ar : %s" --stat | head -n 500 | fabric -sp summarize_git_changes

I think that all patterns should explain the data usage for privacy and compliance reasons.

nopslip commented 3 months ago

Breaking the command down into smaller chunks allows you to examine what is being sent to OpenAi.

Anything before | fabric -sp summarize_git_changes happens independently of Fabric. For example:

✭ ᐅ  git log --pretty=format:"%h - %an, %ar : %s" --stat | head -n 500

Returns this when run against a local repository of mine:

71069d1 - zKWolf, 12 days ago : Merge branch 'main' of https://github.com/nopslip/NP4k-extractor
5e54cbf - zKWolf, 12 days ago : add readme
 readme.md | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 141 insertions(+)

66c3549 - zKWolf, 12 days ago : Create LICENSE
 LICENSE | 661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 661 insertions(+)

35261f9 - zKWolf, 12 days ago : OG commit
 _output_sample.list.txt_1709925366.json | 237 ++++++++++++++++++++++++++++++++
 _output_sample.list.txt_1709930183.txt  |  45 ++++++
 extract_articles.py                     | 119 ++++++++++++++++
 sample.list.txt                         |   5 +
 4 files changed, 406 insertions(+)

This text is piped to the Fabric pattern you use in the INPUT section. For the summarize_git_changes pattern we would be sending this to OPEN AI:

IDENTITY and PURPOSE
You are an expert project manager and developer, and you specialize in creating super clean updates for what changed a Github project in the last 7 days.

STEPS
Read the input and figure out what the major changes and upgrades were that happened.

Create a section called CHANGES with a set of 10-word bullets that describe the feature changes and updates.

OUTPUT INSTRUCTIONS
Output a 20-word intro sentence that says something like, "In the last 7 days, we've made some amazing updates to our project focused around 
."

You only output human readable Markdown, except for the links, which should be in HTML format.

Write the update bullets like you're excited about the upgrades.

INPUT:
INPUT:
71069d1 - zKWolf, 12 days ago : Merge branch 'main' of https://github.com/nopslip/NP4k-extractor
5e54cbf - zKWolf, 12 days ago : add readme
 readme.md | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 141 insertions(+)

66c3549 - zKWolf, 12 days ago : Create LICENSE
 LICENSE | 661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 661 insertions(+)

35261f9 - zKWolf, 12 days ago : OG commit
 _output_sample.list.txt_1709925366.json | 237 ++++++++++++++++++++++++++++++++
 _output_sample.list.txt_1709930183.txt  |  45 ++++++
 extract_articles.py                     | 119 ++++++++++++++++
 sample.list.txt                         |   5 +
 4 files changed, 406 insertions(+)

Essentially it's:

[your input/text/context + Fabric Pattern prompt] --> Open AI

Ultimately, the input/context that you feed to Fabric (and thus OpenAI) is completely up to you (outside of the pattern itself).

HatBeardMe commented 3 months ago

Thank you for the explanation. I saw the pattern doc, but I didn't understand that was the prompt for the chatbot. I was concerned that fabric might "do something else" (e.g., git diff) with my repo to get change information - outside of what was piped in.

Glad to have that cleared up, thanks @zKWolf