forked from phoenix/litellm-mirror
(docs) using auto evals
This commit is contained in:
parent
7ddd29da93
commit
e355a0674f
1 changed files with 1 additions and 3 deletions
|
@ -239,7 +239,6 @@ See autoevals docs on the [supported evaluators](https://www.braintrustdata.com/
|
||||||
```python
|
```python
|
||||||
# auto evals imports
|
# auto evals imports
|
||||||
from autoevals.llm import *
|
from autoevals.llm import *
|
||||||
import openai
|
|
||||||
###################
|
###################
|
||||||
import litellm
|
import litellm
|
||||||
|
|
||||||
|
@ -254,10 +253,9 @@ response = litellm.completion(
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
print(response)
|
||||||
# use the auto eval Factuality() evaluator
|
# use the auto eval Factuality() evaluator
|
||||||
evaluator = Factuality()
|
evaluator = Factuality()
|
||||||
openai.api_key = "" # set your openai api key for evaluator
|
|
||||||
result = evaluator(
|
result = evaluator(
|
||||||
output=response.choices[0]["message"]["content"], # response from litellm.completion()
|
output=response.choices[0]["message"]["content"], # response from litellm.completion()
|
||||||
expected="India", # expected output
|
expected="India", # expected output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue