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

feat: add relevant chunks prompts #745

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions nemoguardrails/llm/prompts/llama3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ prompts:
content: "This is how a conversation between a user and the bot can go:"
- "{{ sample_conversation | to_messages_v2 }}"

- type: system
content: |
{% if context.relevant_chunks %}
# This is some additional context:
```markdown
{{ context.relevant_chunks }}
```
{% endif %}

- type: system
content: |-
"These are the most likely user intents:"
Expand Down Expand Up @@ -287,6 +296,15 @@ prompts:
content: "This is the current conversation between the user and the bot:"
- "{{ history | colang | to_messages_v2 }}"

- type: system
content: |
{% if context.relevant_chunks %}
# This is some additional context:
```markdown
{{ context.relevant_chunks }}
```
{% endif %}

- type: system
content: "Continuation of interaction:"

Expand Down
18 changes: 18 additions & 0 deletions nemoguardrails/llm/prompts/openai-chatgpt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ prompts:
content: "This is how a conversation between a user and the bot can go:"
- "{{ sample_conversation | to_messages_v2 }}"

- type: system
content: |
{% if context.relevant_chunks %}
# This is some additional context:
```markdown
{{ context.relevant_chunks }}
```
{% endif %}

- type: system
content: |-
"These are the most likely user intents:"
Expand Down Expand Up @@ -277,6 +286,15 @@ prompts:
content: "This is the current conversation between the user and the bot:"
- "{{ history | colang | to_messages_v2 }}"

- type: system
content: |
{% if context.relevant_chunks %}
# This is some additional context:
```markdown
{{ context.relevant_chunks }}
```
{% endif %}

- type: system
content: "Continuation of interaction:"

Expand Down
15 changes: 15 additions & 0 deletions nemoguardrails/llm/prompts/openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ prompts:
# These are the most likely user intents:
{{ examples }}


{% if context.relevant_chunks %}
# This is some additional context:
```markdown
{{ context.relevant_chunks }}
```
{% endif %}

# This is the current conversation between the user and the bot:
{{ history | colang }}

Expand Down Expand Up @@ -233,6 +241,13 @@ prompts:
# This is the current conversation between the user and the bot:
{{ history | colang }}

{% if context.relevant_chunks %}
# This is some additional context:
```markdown
{{ context.relevant_chunks }}
```
{% endif %}

bot intent:

- task: generate_flow_continuation_from_flow_nld
Expand Down