Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type validation failed - eval_duration is undefined #38

Open
ashokgelal opened this issue Feb 10, 2025 · 0 comments
Open

Type validation failed - eval_duration is undefined #38

ashokgelal opened this issue Feb 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ashokgelal
Copy link

Describe the bug
Every now and then, a type validation error is thrown for eval_duration.

AI_TypeValidationError: Type validation failed: Value: {"model":"gemma2:2b","created_at":"2025-02-10T18:30:57.020119Z","message":{"role":"assistant","content":""},"done_reason":"stop","done":true,"total_duration":150417167,"load_duration":33204875,"prompt_eval_count":96,"prompt_eval_duration":114000000,"eval_count":1}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "number",
    "received": "undefined",
    "path": [
      "eval_duration"
    ],
    "message": "Required"
  }
]
    at _TypeValidationError2.wrap (chunk-AHZXJXRI.js?v=9eef44bb:407:87)
    at safeValidateTypes (chunk-AHZXJXRI.js?v=9eef44bb:874:34)
    at safeParseJSON (chunk-AHZXJXRI.js?v=9eef44bb:909:30)
    at Object.transform (ollama-ai-provider.js?v=9eef44bb:555:13)Caused by: ZodError: [
  {
    "code": "invalid_type",
    "expected": "number",
    "received": "undefined",
    "path": [
      "eval_duration"
    ],
    "message": "Required"
  }
]
    at get error (chunk-AALBOWSK.js?v=9eef44bb:510:23)
    at Object.validate (chunk-AHZXJXRI.js?v=9eef44bb:846:101)
    at safeValidateTypes (chunk-AHZXJXRI.js?v=9eef44bb:868:31)
    at safeParseJSON (chunk-AHZXJXRI.js?v=9eef44bb:909:30)
    at Object.transform (ollama-ai-provider.js?v=9eef44bb:555:13)

To Reproduce
Send same set of messages multiple times (i.e. try sending where there is no new user message). Following is a sample payload:

{"model":"gemma2:2b","options":{"temperature":0},"messages":[{"content":"tell me an interesting fact","role":"user"},{"content":"Did you know that there's a species of jellyfish that's essentially immortal? \n\nThe **Turritopsis dohrnii**, also known as the \"immortal jellyfish,\" can revert back to its polyp stage after reaching sexual maturity, effectively starting its life cycle all over again. This means it can potentially live forever!  🤯\n\n\nLet me know if you want to hear another interesting fact! 😊\n","role":"assistant"}]}

Expected behavior
It shouldn't throw a validation error
Screenshots

Image

Additional context
This is only reproducible if there is no new new message attached in the messages array. I'm using this to implement "continue" behavior.

@sgomez sgomez added the bug Something isn't working label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants