Comments (6)
Yep, you can put it on the defaultTest
object. See here: https://promptfoo.dev/docs/configuration/expected-outputs/model-graded/#multiple-graders
from promptfoo.
It should be a single object, not an array:
- type: llm-rubric
value: is not apologetic
provider:
id: azureopenai:embeddings:text-embedding-ada-002
config:
temperature: 0
max_tokens: 128
#...
from promptfoo.
Thanks @typpo, appreciate the quick feedback, this error is gone! However now getting the below:
Error: Not implemented
at AzureOpenAiEmbeddingProvider.callApi (...\npm\node_modules\promptfoo\dist\src\providers\azureopenai.js:76:15)
at matchesLlmRubric (...\npm\node_modules\promptfoo\dist\src\matchers.js:227:38)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runAssertion (...\npm\node_modules\promptfoo\dist\src\assertions.js:667:17)
at async ...\npm\node_modules\promptfoo\dist\src\assertions.js:82:24
Is there any difference in between using
id: azureopenai:embedding:text-embedding-ada-002
as per https://www.promptfoo.dev/docs/configuration/expected-outputs/similar/
or
id: azureopenai:embeddings:text-embeddings-ada-002
as per #323 (comment)
from promptfoo.
Ah, I didn't notice you were using llm-rubric
, but that requires a text generation provider (like gpt-4), not an embedding provider. More details here
from promptfoo.
Thanks @typpo ! It works now!
One last quick question - can provider details/config be also defined more globally on "assert" level?
I'd like to use the gpt-4 provider for all subsequent llm-rubric and context-* types and currently specify same provider details/config (e.g. apiKey and apiHost) again for each "type", which looks redundant.
currently:
assert:
- type: llm-rubric
value: does not describe self as an AI or chat assistant
threshold: 0.85
provider:
id: azureopenai:chat:gpt-4
config:
apiKey: <key>
apiHost: <url>
- type: llm-rubric
value: is not apologetic
threshold: 0.85
provider:
id: azureopenai:chat:gpt-4
config:
apiKey: <key>
apiHost: <url>
- type: llm-rubric
value: is confident and does not guess or speculate
threshold: 0.85
provider:
id: azureopenai:chat:gpt-4
config:
apiKey: <key>
apiHost: <url>
from promptfoo.
Works like a charm, thanks @typpo!
from promptfoo.
Related Issues (20)
- Allow overriding provider config in prompt or test case
- Using vars on rubricPrompt lacks serialization, leading to the failure of the entire assertion.
- Mistral Instruct prompt erroneously considered as JSON HOT 5
- Not working using text prompt with Palm2 Google Vertex API HOT 1
- Individual external Python assertion that raises exception results in no grading result in JSON output HOT 1
- promptfoo 0.60.0 --share not working HOT 2
- CLI docs request: default behavior of `eval --output` HOT 1
- Support `systemInstruction` for Gemini (PALM) HOT 4
- Allow options to avoid using special characters HOT 4
- How can I set threshold for avg. of test cases scores with csv? HOT 2
- Types for `promptfoo.evaluate` broken when using TS
- Add ability to bust cache from the web UI
- When Python provider raises exception, details are no longer recorded HOT 3
- Ensure percent complete accurately reflects test suite
- Migrations path incorrect in self host docker build HOT 4
- [Web UI] Image previewer not working for variables or failed tests
- CI passes despite failing build HOT 1
- python external assertion not working HOT 2
- [Web UI] Increase robustness of markdown rendering
- Specify a label with a prompt function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promptfoo.