Skip to content

Conversation

@kevinmessiaen
Copy link
Member

Description

Added tool calls support for LLM clients, migrate function call to tool calls

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

@linear
Copy link

linear bot commented Dec 21, 2023

@kevinmessiaen kevinmessiaen marked this pull request as ready for review December 22, 2023 03:00
…api-call-from-functions-to-tools' into feature/gsk-2367-migrate-openai-api-call-from-functions-to-tools
caller_id=self.__class__.__name__,
)
if out.function_call is None or "passed_test" not in out.function_call.args:
if len(out.tool_calls) != 1 or "passed_test" not in out.tool_calls[0].args:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this specific case, we do not expect, that we can make multiple tool calls, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes since we are evaluating a single case we expect it to be evaluated once

class LLMOutput:
message: Optional[str] = None
function_call: Optional[LLMFunctionCall] = None
tool_calls: Sequence[LLMFunctionCall] = field(default_factory=list)
Copy link
Contributor

@AbSsEnT AbSsEnT Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this moment it is ok for a backward compatibility, but I believe, that by the end of the day we need to keep only "tool" and not "function" naming convention and thus related variables like "function_call", as well as we may want change "LLMFunctionCall" to "LLMToolCall"

Copy link
Member Author

@kevinmessiaen kevinmessiaen Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'm not sure if function_call are being used in other PR's and might be used by some users having developed there own test.

I guess it's okay to keep LLMFunctionCall for now since only tool supported for now is of type function. I guess we will need to update it once we have other tools supported by OpenAI.

@mattbit
Copy link
Member

mattbit commented Dec 22, 2023

@kevinmessiaen does this work with openai<1? We might need to add some version constraint in pyproject.toml

@kevinmessiaen
Copy link
Member Author

@kevinmessiaen does this work with openai<1? We might need to add some version constraint in pyproject.toml

Yes, I tried with openai==0.28.1 and it works

…m-functions-to-tools

# Conflicts:
#	giskard/llm/evaluators/base.py
@kevinmessiaen kevinmessiaen marked this pull request as draft January 24, 2024 04:38
@kevinmessiaen kevinmessiaen marked this pull request as ready for review January 24, 2024 06:56
@kevinmessiaen kevinmessiaen requested a review from AbSsEnT January 24, 2024 06:57
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2024

Copy link
Contributor

@AbSsEnT AbSsEnT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@kevinmessiaen kevinmessiaen merged commit 4bf789c into main Feb 5, 2024
@kevinmessiaen kevinmessiaen deleted the feature/gsk-2367-migrate-openai-api-call-from-functions-to-tools branch February 5, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants