ApiReference

class ApiReference(val description: String, api: Api, classLimit: Int = 100) : LlmReference

API reference that can be exposed to LLMs as a prompt contribution and tools. Can also be used in configuration to provide API reference information.

Constructors

Link copied to clipboard
constructor(description: String, api: Api, classLimit: Int = 100)

Properties

Link copied to clipboard
Link copied to clipboard
open val name: String
Link copied to clipboard

Naming strategy for tools associated with this reference. Defaults to prefixing tool names with the tool prefix and an underscore.

Functions

Link copied to clipboard

Convert this reference to a MatryoshkaReference, exposing a single tool object that supports nesting. Do not rewrap a MatryoshkaReference. Thus repeated calls to this method are safe.

Link copied to clipboard
open fun contribution(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun notes(): String

Notes about this reference, such as usage guidance. Does not need to consider prompt prefix, name or description as they will be added automatically.

Link copied to clipboard
open fun toolInstances(): List<Any>

Return the instances of tool object. Defaults to this

Link copied to clipboard

Create a tool object for this reference.

Link copied to clipboard
open fun toolPrefix(): String

A safe prefix for LLM tools associated with this reference. Defaults to the name lowercased with spaces replaced by underscores. Subclasses can override it

Link copied to clipboard
open override fun tools(): List<Tool>

Return framework-agnostic tools provided by this reference. These tools will be added to the PromptRunner when the reference is added.