The LlamaCppAdapter needs to be taught how to correctly format the system prompt to make the LLM aware of the available tools. Different models have different preferred formats for this, so we need a robust way to inject the tool definitions into the context.
Acceptance Criteria:
- The
LlamaCppAdapter has a new internal method that takes a list of Tool objects.
- This method correctly formats the tools into a string (e.g., using XML tags or a JSON structure) that is prepended to the user's prompt or included in the system message.
- The main
generate_structured and generate_freeform methods are updated to use this new formatter when tools are provided.
The
LlamaCppAdapterneeds to be taught how to correctly format the system prompt to make the LLM aware of the available tools. Different models have different preferred formats for this, so we need a robust way to inject the tool definitions into the context.Acceptance Criteria:
LlamaCppAdapterhas a new internal method that takes a list ofToolobjects.generate_structuredandgenerate_freeformmethods are updated to use this new formatter when tools are provided.