I'm trying to run a koog/ktor application, with th...
# koog-agentic-framework
s
I'm trying to run a koog/ktor application, with the configuration in application.yaml:
Copy code
ktor:
    application:
        modules:
            - se.example.ai.ApplicationKt.main

koog:
    openai:
        apikey: $OPEN_AI_API_KEY
        baseUrl: <https://api.openai.com>
However, at startup, there is an error saying "ERROR Application - Failed to read Koog configuration from application config io.ktor.server.config.ApplicationConfigurationException: Path timeout not found." I can't figure out where to put the timeout configuration, and I find no documentation about it. I do have "ktor-server-config-yaml" in my dependencies.
s
Can you try?
Copy code
ktor:
    application:
        modules:
            - se.example.ai.ApplicationKt.main

koog:
    openai:
        apikey: $OPEN_AI_API_KEY
        baseUrl: <https://api.openai.com>
        timeout:
            requestTimeoutMillis: 900000
            connectTimeoutMillis: 60000
            socketTimeoutMillis: 900000
This should be optional, please create an issue otherwise I'll create one ☺️ Also with the Ktor DSL you can do following as well:
Copy code
install(Koog) {
   openAI(System.getenv("OPEN_AI_API_KEY"))
}
s
Thank you Simon! Adding the timeout-block that you suggested gives the same error. I will file an issue. In the meantime I get by with the programmatic configuration.
kodee loving 1
thank you color 1
I was asked to report it in the Koog issue tracker instead: https://github.com/JetBrains/koog/issues/807
👍 1
v
Hi! For me it just worked when adding the timeout on the top level 🙂
Copy code
timeout:
  requestTimeoutMillis: 900000
  connectTimeoutMillis: 60000
  socketTimeoutMillis: 900000
👀 1
s
Yes, that made that particular error go away. Three problems with it, though: 1. Now it says "Failed to read Koog configuration from application config io.ktor.server.config.ApplicationConfigurationException: Path koog.anthropic not found. 2. If it's optional to specify these parameters, they shouldn't cause an error when missing. 3. Are these really global values? They look quite badly placed on the top level of the configuration file.
v
This should be fixed, it’s definitely a bug. For now to workaround just create empty/unused values for all providers