Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions packages/genui/lib/src/facade/prompt_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ final class _BasicPromptBuilder extends PromptBuilder {
final fragments = <String>[
...systemPromptFragments,
'Use the provided tools to respond to user using rich UI elements.',
if (catalog.catalogId != null)
'The active catalog ID is: "${catalog.catalogId}".',
Comment thread
gspencergoog marked this conversation as resolved.
Outdated
...technicalPossibilities.systemPromptFragment(),
...catalog.systemPromptFragments,
...allowedOperations.systemPromptFragments,
Expand Down
11 changes: 11 additions & 0 deletions packages/genui/test/facade/prompt_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,15 @@ void main() {
});
}
});

group('Catalog ID', () {
test('is surfaced in system prompt when provided', () {
final catalog = Catalog([
BasicCatalogItems.text,
], catalogId: 'my_custom_catalog');
final builder = PromptBuilder.chat(catalog: catalog);
final String prompt = builder.systemPromptJoined();
expect(prompt, contains('The active catalog ID is: "my_custom_catalog"'));
});
});
}
Comment thread
gspencergoog marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Use the provided tools to respond to user using rich UI elements.

-------------------------------------

The active catalog ID is: "test_catalog".

-------------------------------------

IMPORTANT: You do not have the ability to execute code. If you need to perform calculations, do them yourself.

-------------------------------------
Expand Down
Loading