Find answers from the community

Home
Members
Lautaro
L
Lautaro
Offline, last seen 2 days ago
Joined September 25, 2024
Hi guys! In my project I've been using OpenAiAgent with llms from OpenAI and, in some cases, AzureOpenAI. Now I would like to be able to use Agents outside OpenAI's ecocystem, like Calude, Bedrock deploys and so on. I couldn't find a "generic" way of building an Agent with other LLMs, I understand the possibility is also constraint in some cases with the capability of function calling, but maybe I didn't search enough. Have anyone faced a similar challenge?
2 comments
W
L
L
Lautaro
·

Faiss

Hi everyone! I wanted to perform a retrieve to a Retriever with a custom MetadataFilter and I noticed (bc of error logged :p) that its not currently supported by the underlying Faiss VectorStore. Has someone faced something like this? I know one approach would be to change the Faiss Vector Store for other one, but I would like to keep it. Maybe someone stumbled across this 👀
1 comment
L
Hi there! I am using AzureOpenAI class to perform a simple request. The problem is that even if I define the max_retries=0 parameter, it doesn't take effect when a BadRequestException occurs due to Azures [hate/violence/sexual/self-harm] filtering
1 comment
L
Hi there! I spotted a small bug within the new llama-index v0.11.0. Migrating Pydantic v1 -> v2 now root_validator is deprecated and model_validator should be used instead. This changes was not performed within llama-index-embeddings-azure-openai package, so when importing the AzureOpenAIEmbedding class the following error raises:
Plain Text
File "[...]/llama_index/embeddings/azure_openai/base.py", line 4, in <module>
    from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator
ImportError: cannot import name 'root_validator' from 'llama_index.core.bridge.pydantic' ([...]/llama_index/core/bridge/pydantic.py)

Just a heads-up before updating if you depend on this sub-package!
6 comments
L
L
Hi there! I recently updated llama-index to the current stable version. I use Azure OpenAI models and in our project when the moderation models were triggered, we would catch the BadRequestError re-raised from llama to identify the category flagged and apply some business logic.
Now with the update, when raised the BadRequestError, another one is raised afterwards:
Plain Text
File ".../python3.10/site-packages/llama_index/core/callbacks/token_counting.py", line 91, in get_llm_token_counts
    raise ValueError(
ValueError: Invalid payload! Need prompt and completion or messages and response.

Is there a way to retrieve the original exception thrown by openai? Anyone faced a similar issue?
18 comments
L
L
Hello everyone! I am using the stream_chat method from OpenAIAgent with Azure OpenAI models. I noticed that Azure's models have some filters and I would like to intercept the openai.BadRequest error before returning the message to the user.
However I noticed that in the write_response_to_history func (https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/chat_engine/types.py#L120), the exception is being captured and only re raised if the raise_error argument is set to true. How should I set this flag when doing agent.stream_chat(user_prompt) 🤔
2 comments
L
L
Hi everyone! I am building a small app with llama-index using Azure OpenAI models with streaming, and now I want to add defaults messages when a user faces a disconnection, or OpenAI has a down-time, and so. Currently I am testing this by manually disconnection my net in the middle of the request, but as I tested, this could also be "simulated" setting max_retires:0 and timeout:0 when instantiating AzureOpenAI class. Regarless, I checked StreamingAgentChatResponse's write_response_to_history(...) method and it caught my eyes that if an exception occurs, the _is_function_not_none_thread_event is never set, which causes the whole request to wait infinitely
3 comments
L
L