what is wrong with the google client (0.5.2), it ...
# koog-agentic-framework
s
what is wrong with the google client (0.5.2), it gives me 500.
a
If it’s 5XX, there’s likely something wrong on the server side. Can you provide an error message you get?
s
222941.586 [http-nio-8080-exec-8] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] threw exception java.lang.IllegalStateException: Error from GoogleAI API: 500 Internal Server Error: { "error": { "code": 500, "message": "An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting", "status": "INTERNAL" } } at ai.koog.prompt.executor.clients.google.GoogleLLMClient$getGoogleResponse$response$1.invokeSuspend(GoogleLLMClient.kt:263) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704) 222941.586 [http-nio-8080-exec-8] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.IllegalStateException: Error from GoogleAI API: 500 Internal Server Error: { "error": { "code": 500, "message": "An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting", "status": "INTERNAL" } } ] with root cause java.lang.IllegalStateException: Error from GoogleAI API: 500 Internal Server Error: { "error": { "code": 500, "message": "An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting", "status": "INTERNAL" } } at ai.koog.prompt.executor.clients.google.GoogleLLMClient$getGoogleResponse$response$1.invokeSuspend(GoogleLLMClient.kt:263) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
sorry, did not see this in the threads.
a
I tested Google client just now and it works for me. Can you provide more details and maybe a code snippet, how you configure your Google client?
Copy code
public suspend fun reduce(utterance: String?): Reservable {
  val instruction = """
      |# Schema Update Prompt
      |
      |**System role**
      |Schema Update Synthesizer for the Buildmate reservation design agent.
      |
      |**Mission**
      |Absorb the newest staff input and reconcile it with the RequirementManifest while keeping the design-stage schema representation precise, reusable, and aligned with the meta schema contract used by builders. This prompt runs only after the ontopic gate confirms the utterance is schema-relevant and free of blocking contradictions.
      |
      |- **Meta schema alignment**
      |The agent must shape the manifest based on the conversation with staff so every reservable follows the meta definition:
      |- `Reservable` is composite: it declares resource entries, each referencing a `ResourceDefinition`. Facets are declared at definition sites (resources), not on reservable entries. Reservable labels act as the service identifier during design.
      |- The conversation establishes or reuses the appropriate definitions for each type slot. The reservable entry can reference shared `ResourceType` or `FacetType` identifiers when that reflects the domain.
      |- Every definition (resource, facet, reservable—built-in or user-authored) is structured to compile into an OpenCUI entity for downstream tooling.
      |- Every definition carries a canonical `label` and may include optional design annotations (`notes`) without changing how the schema links entities.
      |- Each custom facet is registered through the `FacetDefinition` interface; the agent selects the appropriate concrete form (ordered vs unordered) based on whether staff confirm enumerated values. Operator expectations follow from the chosen structure—no need for staff to specify the type explicitly.
      |- We have ReservableInterface, and the manifest exposes a single reservation entry that references it.
      |- Meta policies and compliance blueprints must reference these same types; introduce no instance-specific identifiers during the design stage.
      |
      |**Inputs**
      |- `current_manifest` (JSON) covering business_type, ResourceDefinition[], FacetDefinition[] and an optional Reservation entry for the design stage. Downstream enforcement derives from these design-time facets; no separate constraint collection is modeled here.
      |- `utterance` (string) newest staff message.
      |
      |**Process**
      |1. Treat the provided `current_manifest` as the authoritative design-stage state for this turn; do not rely on cached or external manifests.
      |2. Parse `utterance`; extract confirmed facts, corrections, clarifications, and explicit unknowns.
      |3. Reconcile against `current_manifest`:
      |   - Preserve confirmed information unless staff overrides it.
      |   - Reject unverifiable guesses; surface conflicts instead of hallucinating.
      |   - Apply minimal edits per blueprint to reflect new information. Do not emit a diff here; storage can derive it.
      |4. Enforce meta schema (design scope):
      |   - Ensure every `ResourceDefinition` captures a `label` and optional `facets`; when `facets` is present, entries reference existing `FacetDefinition.label` values (capacity treated as a facet, not a separate field).
      |   - Verify each facet referenced by the reservation's resources exists in `facet_definitions`, selecting the ordered or unordered shape as appropriate and capturing any enumerated values or design notes (operator expectations derive from the shape).
      |   - If `reservation` is present, validate that each listed resource resolves to a `ResourceDefinition`. Facets are declared at definition sites only; reservable entries do not carry facet lists.
      |   - Flag gaps (missing facet operator guidance, ambiguous resource allocations) instead of inferring defaults.
      |5. Do not generate follow-up questions here; leave that to the Question Planner. If information is missing, preserve current values without adding inline comments and rely on downstream planners to flag the gap.
      |
      |**Output**
      |- Output only the updated `RequirementManifest` as minified JSON.
      |- No wrapper fields, prose, or trailing commentary—return the raw JSON object only.
      |
      |**Constraints**
      |- Never invent personally identifying data.
      |- Respect facet structure and declared enforcement expectations; do not introduce facet values without justification.
      |- Express durations in ISO 8601 and slot boundaries in the business's local timezone without DST errors.
      |- Capture explicit links between the chosen resources and any referenced rules or behaviors.
      |- If no manifest change is warranted, still echo the manifest unchanged; no additional narrative is required.
      |- Defer instance-level resource or customer data to the implementation stage; summarize it as a checklist item instead of embedding it in the design manifest.
      |- Treat the returned manifest as the new canonical state; downstream systems handle persistence.
      |
      |---
      |
      |Manifest outline (authoritative structure)
      |
|${Json.buildSchema<Reservable>()} |``` | |Labels and paths |- Labels must be unique per collection and should be clear, human-readable handles (Title Case or concise camel case both acceptable). Examples:
Dining Table
,
Dinner Service
,
Capacity
. |- Path syntax: dot notation with bracketed labels for arrays/maps. Examples: | -
ResourceDefinition[Dining Table].facets[0]
| -
FacetDefinition[Capacity].notes
| |Validation rules (design stage) |- Labels are unique per collection and treated as canonical linkage handles. |- Reservation.resources length ≥ 1. |- All references resolve: | - Reservation.resources[*] → ResourceDefinition.label | - ResourceDefinition.facets[*] → FacetDefinition.label |- Unordered facet definitions provide
allowed_values
(≥1 item). |- Ordered facets imply quantitative operators (
>
,
<
,
=
,
<=
,
>=
,
exact
,
fuzzy
); unordered facets imply categorical operators (
exact
,
fuzzy
,
in
,
subset
). |- For every facet referenced by the reservation entry, at least one listed resource should actually expose it so downstream enforcement remains feasible. | |Determinism |- Sort all output collections by
label
(or
manifest_version
where applicable) for reproducible diffs. |- Return minified, valid JSON only (no comments or narrative). | |Time and timezone rules |- When adding or changing time-related facet definitions (e.g., duration ranges) or introducing reservation behavior assumptions, ensure the values align with the designated business timezone and remain DST-safe without emitting extra commentary. | |Non-goals (design stage) |- Do not generate follow-up questions (handled by the Question Planner). |- Do not emit a changeset or narrative summary. |- Do not infer facet values or invent defaults without explicit staff confirmation. |- Do not introduce instance-level records (customers, bookings, runtime data) or PII. |- Do not evaluate enforcement semantics; only ensure facet linkages are structurally valid. Operands or thresholds are captured during implementation. |- Do not add or remove unrelated entities beyond the minimal changes needed to reflect
utterance
. | |Checklist canonical fields (for downstream planners) |-
business_type
|-
res.definitions
,
res.facets
|-
reservation.definition
|-
facet.values
| | |# Inputs |## current_manifest |~~~json |${reservation} |~~~ | |## utterance |~~~text |${utterance} |~~~ |""".trimMargin() val system1Id: String = "expert" val system1Builder = session?.getSystem1Builder(system1Id, "ai.bethere.reservationBuilder")!! as KoogSystem1Builder val augmentation = Augmentation(instruction, mode=System1Mode.FUNCTION) augmentation.basicSchema = true system1Builder.renderThinking(session!!, "ai.bethere.reservationBuilder.RequirementReduction", "reduce", augmentation) val system1Func = system1Builder.build<Reservable>(session!!, augmentation) as KoogFunction<Reservable> return system1Func.invoke() }``` shows how I use my scaffold defined in KoogSystem1 to define llm based functions.
can you share your code snippet for using gemini for structured output?
I can trace back from there as well.
I just use executor directly, simpleGoogleAIExecutor(model.apikey!!)
and then build aiagent for string, string, or structured output.
a
You can check this simple example, it just does a one-shot request to the LLM. Google client works fine for me here https://github.com/JetBrains/koog/blob/develop/examples/simple-examples/src/main/kotlin/ai/koog/agents/example/attachments/InstagramPostDescriber.kt
s
this is not going through the aiagent (structured output) code path, do you have a simple example of that?
i can run this as well.
found the issue, thanks.
Google api verify the input to be not empty.
👍 1