Skip to content

Commit 38809c6

Browse files
authored
Merge pull request #159 from oracle-samples/110-modelapi-list-generation
use get_args
2 parents 939835d + 321ad35 commit 38809c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/common/schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
# spell-checker:ignore ollama, hnsw, mult, ocid, testset
66

7-
from typing import Optional, Literal, Union
7+
from typing import Optional, Literal, Union, get_args
88
from pydantic import BaseModel, Field, PrivateAttr, model_validator
99

1010
from langchain_core.messages import ChatMessage
@@ -131,8 +131,8 @@ class Model(ModelAccess, LanguageModelParameters, EmbeddingModelParameters):
131131
@model_validator(mode="after")
132132
def check_api_matches_type(self):
133133
"""Validate valid API"""
134-
ll_apis = LlAPI.__args__
135-
embed_apis = EmbedAPI.__args__
134+
ll_apis = get_args(LlAPI)
135+
embed_apis = get_args(EmbedAPI)
136136

137137
if not self.api or self.api == "unset":
138138
return self

0 commit comments

Comments
 (0)