hi, how do I deal with files: uploading files to t...
# koog-agentic-framework
b
hi, how do I deal with files: uploading files to the LLM (such as images or pdfs) or extracting files from the response
d
Hey Bernhard, have you tried what's described in this page of Koog's documentation? Does this fit your needs? Or are you needing something more?
b
ah, I skipped over that one because I couldn't make sense of the multimodal content headline
😃 2
so what I don't fully understand is how prompts can be combined with agents
agent.run only takes a string and returns a string
that plus I think extracting the content is not obvious; I suppose it's persisted on some kind of llm response object?
d
Agent.run
takes whatever input type you specified as type parameter of your agent. Cf. this thread. If you need more explanations, please tell me and I will put some sample code there.
b
ok, read the thread and don't understand anything
the types also don't typecheck
so let's say a user sends a message to an agent telling them to figure out some text inside of it
I don't see a prompt method on the agent
Copy code
suspend fun main() {
    val agent = AIAgent<Message.User, List<Message.Response>>(
        promptExecutor = simpleGoogleAIExecutor(System.getenv("GOOGLE_AI_API_KEY")),
        systemPrompt = "You are a waiter at a Michelin starred restaurant",
        llmModel = GoogleModels.Gemini2_5Flash,
    )

    val result = agent.run("hi")
    print(result)
}
No type arguments expected for fun invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor? = ..., strategy: AIAgentGraphStrategy<String, String> = ..., toolRegistry: ToolRegistry = ..., id: String? = ..., systemPrompt: String? = ..., temperature: Double? = ..., numberOfChoices: Int = ..., maxIterations: Int = ..., installFeatures: GraphAIAgent.FeatureContext.() -> Unit = ...): AIAgent<String, String>.
happens on the agent line
d
I'll whip some example code after lunch!
b
thank you
d
@Bernhard here you go: https://kotlinlang.slack.com/archives/C08SLB97W23/p1775559461685529?thread_ts=1775524387.702669&cid=C08SLB97W23 Tell me if things are more clear after reading this example.