Skip to content

Commit

Permalink
Only firefunction is function calling (#11363)
Browse files Browse the repository at this point in the history
  • Loading branch information
derikk authored Feb 26, 2024
1 parent 3a10235 commit 70d4a5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from llama_index.core.types import BaseOutputParser, PydanticProgramMode
from llama_index.llms.fireworks.utils import (
fireworks_modelname_to_contextsize,
is_function_calling_model,
)
from llama_index.llms.openai import OpenAI

Expand Down Expand Up @@ -64,7 +65,9 @@ def metadata(self) -> LLMMetadata:
num_output=self.max_tokens,
is_chat_model=True,
model_name=self.model,
is_function_calling_model=True,
is_function_calling_model=is_function_calling_model(
model=self._get_model_name()
),
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def fireworks_modelname_to_contextsize(modelname: str) -> int:
return context_size


def is_function_calling_model(model: str) -> bool:
return "function" in model


def _message_to_fireworks_prompt(message: ChatMessage) -> Dict[str, Any]:
if message.role == MessageRole.USER:
prompt = {"role": "user", "content": message.content}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description = "llama-index llms fireworks integration"
license = "MIT"
name = "llama-index-llms-fireworks"
readme = "README.md"
version = "0.1.2"
version = "0.1.3"

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

0 comments on commit 70d4a5c

Please sign in to comment.