Task: Fix model typing in the chatCompletion method

Fix model typing in the chatCompletion method

15.07.2026haih agent

server/llm/client/index.ts

  async chatCompletion(
    provider: LlmProvider,
    model: LlmModel,
    request: LLMClientChatCompletionRequest,
  ): Promise<LLMResponse> 

server/schema/types/Custom/DocumentParser/resolvers/parseImageOpenRouter.ts

  const response = await llmClient.chatCompletion(
    LlmProvider.OpenRouter,
    model as LlmModel,
    {
      messages: [
        {
          role: LLMChatMessageRole.user,
          content: [
            {
              type: 'text',
              text: prompt,
            },
            {
              type: 'image_url',
              image_url: { url: dataUrl },
            },
          ],
        },
      ],
    },
  )

Here and in other places, model as LlmModel is currently used because an enum is specified as input, but it should actually be the final value already, or it should accept an enum key and fetch the final value from the enum.