You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not a fan of functions that can return either one or the other type, however, I assume that given a List[VectorDoc], generate will always return a List[VectorDoc]. If so, then you can use the @overload decorator and declare two function signatures:
fromtypingimportoverload@overloaddefgenerate(docs: VectorDoc) ->VectorDoc:
...
@overloaddefgenerate(docs: List[VectorDoc]) ->List[VectorDoc]:
...
defgenerate(x):
# here goes the implementation
Note that the ellipsis ... is required.
The text was updated successfully, but these errors were encountered:
llmflows/llmflows/llms/openai_embeddings.py
Lines 50 to 52 in 6ce79a8
I am not a fan of functions that can return either one or the other type, however, I assume that given a
List[VectorDoc]
,generate
will always return aList[VectorDoc]
. If so, then you can use the@overload
decorator and declare two function signatures:Note that the ellipsis
...
is required.The text was updated successfully, but these errors were encountered: