Skip to content

Commit

Permalink
AIModels: Changed some type annotations for list parameter to Iterables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Jan 19, 2024
1 parent 7883e3c commit 5cae3eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions esbmc_ai_lib/ai_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Author: Yiannis Charalambous

from abc import abstractmethod
from typing import Any, Union
from typing import Any, Iterable, Union
from enum import Enum
from typing_extensions import override

Expand Down Expand Up @@ -49,7 +49,7 @@ def create_llm(

@classmethod
def convert_messages_to_tuples(
cls, messages: list[BaseMessage]
cls, messages: Iterable[BaseMessage]
) -> list[tuple[str, str]]:
"""Converts messages into a format understood by the ChatPromptTemplate - since it won't format
BaseMessage derived classes for some reason, but will for tuples, because they get converted into
Expand All @@ -58,7 +58,7 @@ def convert_messages_to_tuples(

def apply_chat_template(
self,
messages: list[BaseMessage],
messages: Iterable[BaseMessage],
**format_values: Any,
) -> PromptValue:
# Default one, identity function essentially.
Expand Down Expand Up @@ -157,7 +157,7 @@ def create_llm(
@override
def apply_chat_template(
self,
messages: list[BaseMessage],
messages: Iterable[BaseMessage],
**format_values: Any,
) -> PromptValue:
"""Text generation LLMs take single string of text as input. So the conversation
Expand Down

0 comments on commit 5cae3eb

Please sign in to comment.