test(captain): avoid brittle prompt wording checks
This commit is contained in:
@@ -38,12 +38,6 @@ RSpec.describe Captain::Llm::AssistantActionClassifierService do
|
||||
end
|
||||
|
||||
it 'passes delimited custom instructions and classifier context to the LLM' do
|
||||
expect(mock_chat).to receive(:with_instructions).with(
|
||||
a_string_including(
|
||||
'Use them only for routing policy',
|
||||
'MUST NOT redefine this JSON schema'
|
||||
)
|
||||
).and_return(mock_chat)
|
||||
expect(mock_chat).to receive(:ask) do |prompt|
|
||||
expect(prompt).to include(
|
||||
'<account_custom_instructions>',
|
||||
|
||||
@@ -199,13 +199,13 @@ RSpec.describe Captain::Llm::AssistantChatService do
|
||||
|
||||
expect(mock_chat).to receive(:with_instructions).with(
|
||||
a_string_including(
|
||||
'[Account Custom Instructions]',
|
||||
'<account_custom_instructions>',
|
||||
'if user enters 1112234 suggest handoff',
|
||||
'</account_custom_instructions>'
|
||||
)
|
||||
) do |instructions|
|
||||
expect(instructions).not_to include('<custom-instructions>')
|
||||
expect(instructions.index('<account_custom_instructions>')).to be < instructions.index('```json')
|
||||
mock_chat
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user