Skip to content

FaithfulnessEvaluator with Mistral AI API #8709

Closed as duplicate of#8918
Closed as duplicate of#8918
@miam-bonbon

Description

@miam-bonbon

Describe the bug
Cannot use FaithfulnessEvaluator with Mistral AI API

Error message
Error: Error code: 422 - {'object': 'error', 'message': {'detail': [{'type': 'extra_forbidden', 'loc': ['body', 'seed'], 'msg': 'Extra inputs are not permitted', 'input': 42}]}, 'type': 'invalid_request_error', 'param': None, 'code': None}
httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url 'https://api.mistral.ai/v1/chat/completions'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422

During handling of the above exception, another exception occurred:

openai.UnprocessableEntityError: Error code: 422 - {'object': 'error', 'message': {'detail': [{'type': 'extra_forbidden', 'loc': ['body', 'seed'], 'msg': 'Extra inputs are not permitted', 'input': 42}]}, 'type': 'invalid_request_error', 'param': None, 'code': None}

Expected behavior
Using FaithfulnessEvaluator with Mistral AI API

To Reproduce
Here's my code:
api_endpoint = "https://api.mistral.ai/v1" evaluator = FaithfulnessEvaluator(api_params={"api_base_url": api_endpoint, "api_key": os.environ["MISTRAL_API_KEY"], "model": "mistral-large-latest"})

I tried changing
evaluator.api = "mistral"
but to no avail

And even
evaluator.api_key._env_vars to "MISTRAL_API_KEY" since it's value is "OPENAI_API_KEY"

FAQ Check

System:

  • OS:
  • GPU/CPU:
  • Haystack version (commit or version number):
  • DocumentStore:
  • Reader:
  • Retriever:

Question
What am I missing? Any help or hint would be greatly appreciated!
Or is this simply not supported by FaithfulnessEvaluator or does the Mistral AI API not fully implement the openai "quasi-standard"?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority, leave it in the backlog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions