Skip to content

bug: Additional properties are not allowed for azure oai #95

Open
@Pixel-Pox

Description

@Pixel-Pox

What happened?

When querying dbally with azure openai creds, a wrong prompt template is used

Error code: 400 - {'error': {'message': "Additional properties are not allowed ('is_example' was unexpected) - 'messages.0'", 'type': 'invalid_request_error', 'param': None, 'code': None}}

This can be fixed by commenting out "is_example": message.get("is_example", False) in dbally.prompt.template -> PromptTemplate.format_prompt()... But ofc it should take into consideration other LiteLLM options.

How can we reproduce it?

import dbally
from dbally.audit import CLIEventHandler
from dbally.llms.litellm import LiteLLM

os.environ['LITELLM_LOG'] = 'DEBUG'

os.environ["AZURE_API_KEY"] = "actual-key"
os.environ["AZURE_API_BASE"] = "actual-url"
os.environ["AZURE_API_VERSION"] = "2024-08-01-preview"

llm = LiteLLM(model_name="azure/gpt-4")
my_collection = dbally.create_collection("my_collection", llm, event_handlers=[CLIEventHandler()])
my_collection.add(MyView, lambda: MyView(engine))
result = await my_collection.ask("which llm to use?")

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions