Skip to content

Commit

Permalink
Fix vector query engine exceeding token limits (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter authored Apr 26, 2024
1 parent 30d3e29 commit f2ac9ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion griptape/engines/query/vector_query_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def query(
if message_token_count + self.answer_token_offset >= tokenizer.max_input_tokens:
text_segments.pop()

user_message = self.user_template_generator.render(query=query, text_segments=text_segments)
system_message = self.system_template_generator.render(
rulesets=J2("rulesets/rulesets.j2").render(rulesets=rulesets),
metadata=metadata,
text_segments=text_segments,
)

break

Expand Down

0 comments on commit f2ac9ca

Please sign in to comment.