Skip to content

TypeError: 'float' object is not iterable on ivocation #961

@Blakeinstein

Description

@Blakeinstein

if isinstance(raw_content, int): # type: ignore
raw_content = str(raw_content) # type: ignore

When sending a message like "16.2" the library fails on line 314. I am assuming its because isinstance(raw_content, float) is not handled

pass
# A linting error is thrown here because it does not think this line is
# reachable due to typing, but mypy is wrong so we ignore the lint
# error.
if isinstance(raw_content, int): # type: ignore
raw_content = str(raw_content) # type: ignore
if isinstance(raw_content, str):
raw_content = [raw_content]
result = []
for raw_part in raw_content:
part = _convert_to_prompt(raw_part)
if part:
result.append(part)
return result
vertex_messages: List[Content] = []

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions