Skip to content

fix: accept documented log_hyperparameters decorator call forms - #3135

Open
BetterAndBetterII wants to merge 1 commit into
confident-ai:mainfrom
BetterAndBetterII:fix/log-hyperparameters-decorator
Open

fix: accept documented log_hyperparameters decorator call forms#3135
BetterAndBetterII wants to merge 1 commit into
confident-ai:mainfrom
BetterAndBetterII:fix/log-hyperparameters-decorator

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Summary

@deepeval.log_hyperparameters() and @deepeval.log_hyperparameters(model=..., prompt_template=...) raised TypeError because log_hyperparameters only accepted a bare function argument. Both forms are used in the docs.

Make the decorator accept optional call/kwargs while keeping the existing bare @deepeval.log_hyperparameters form. Decorator kwargs are merged with the wrapped function’s returned dict (function values win on key clashes).

Fixes #3134

Test plan

  • pytest tests/test_core/test_run/test_log_hyperparameters.py
  • empty @log_hyperparameters() logs the returned dict
  • keyword form merges decorator kwargs with the returned dict
  • bare @log_hyperparameters still works

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@BetterAndBetterII is attempting to deploy a commit to the Confident AI Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log_hyperparameters documented decorator forms raise TypeError

1 participant