chat

fun chat(client: OpenAIClient, model: String, systemPrompt: String, conversationContext: String, senderName: String, content: String, entity: JeevesEntity): JeevesAIEngine.AIResult?(source)

Sends a chat message to the AI with world context and tool definitions.

When the LLM calls informational tools (like search_locations), results are fed back automatically and the LLM continues reasoning. Action tools are returned in the AIResult for the caller to execute on the server thread.

Return

An AIResult with optional message and actions, or null on error

Parameters

client

The OpenAI client to use

model

The model identifier

systemPrompt

The Jeeves personality system prompt

conversationContext

Recent conversation history formatted as text

senderName

The player who sent the message

content

The player's message

entity

The Jeeves entity for world context gathering