Skip to content

Commit

Permalink
feat: Resolving UserWarning about llama-index-llms-dashscope (run-lla…
Browse files Browse the repository at this point in the history
…ma#16965)

* feat: Resolving UserWarning about llama-index-llms-dashscope

In Pydantic V2, protected_namespaces is a configuration option used to prevent certain namespace keywords
          (such as model_, etc.) from being used as field names. so we need to disable it here.

* Update pyproject.toml

update version to 0.2.6

* lint

---------

Co-authored-by: Andrei Fajardo <[email protected]>
  • Loading branch information
yuzilog and nerdai authored Nov 15, 2024
1 parent 8b814ae commit 74624dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from http import HTTPStatus
from typing import Any, Dict, List, Optional, Sequence, Tuple
from pydantic import ConfigDict

from llama_index.core.base.llms.types import (
ChatMessage,
Expand Down Expand Up @@ -121,6 +122,11 @@ class DashScope(CustomLLM):
```
"""

""" In Pydantic V2, protected_namespaces is a configuration option used to prevent certain namespace keywords
(such as model_, etc.) from being used as field names. so we need to disable it here.
"""
model_config = ConfigDict(protected_namespaces=())

model_name: str = Field(
default=DashScopeGenerationModels.QWEN_MAX,
description="The DashScope model to use.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-llms-dashscope"
readme = "README.md"
version = "0.2.5"
version = "0.2.6"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down

0 comments on commit 74624dd

Please sign in to comment.