Skip to content

Conversation

@AbSsEnT
Copy link
Contributor

@AbSsEnT AbSsEnT commented Apr 12, 2024

Description

Related Issue

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

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.
  • I've updated the pdm.lock running pdm update-lock (only applicable when pyproject.toml has been
    modified)

…ich returns a prediction from the row of the dataset.
… is called. Replaced placeholders and dummy variables to the real objects.
…skard-AI/giskard into feature/gsk-2335-query-prediction-for-the-row-from-the-dataset
…flow. Performed prompt engineering for the tool description and LLM instruction.
…skard-AI/giskard into feature/gsk-2335-query-prediction-for-the-row-from-the-dataset
…ction-for-the-row-from-the-dataset

Implementation of the "PredictFromDatasetTool"
…skard-AI/giskard into feature/gsk-2336-query-shap-prediction-explanation
…-to-tools' of github.com:Giskard-AI/giskard into feature/gsk-2336-query-shap-prediction-explanation
…-to-tools' of github.com:Giskard-AI/giskard into feature/gsk-2334-talk-to-my-model-mvp
…skard-AI/giskard into feature/gsk-2336-query-shap-prediction-explanation
…prediction-explanation

Feature/gsk 2336 query shap prediction explanation
…-to-tools' of github.com:Giskard-AI/giskard into feature/gsk-2419-adapt-workflow-to-the-tools-api
}

@staticmethod
def _gather_context(message_list: list) -> str:
Copy link
Member

Choose a reason for hiding this comment

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

Could be nice to check that the resulting string is not too long for the context windows of the LLM

Comment on lines 5 to 6
def get_talk_llm_model() -> str:
return os.getenv("GSK_TALK_LLM_MODEL", "gpt-4-0125-preview")
Copy link
Member

Choose a reason for hiding this comment

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

This is unused I think, we can remove it

@rabah-khalek rabah-khalek enabled auto-merge (squash) April 18, 2024 07:40
class ToolChatMessage(ChatMessage):
name: Optional[str] = None
tool_call_id: Optional[str] = None
tool_calls: Optional[list] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick, could be more precise: Optional[list[ChatCompletionMessageToolCall]]

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll add it, I forget if adding a typing based on a conditional imports create troubles (even if put under quotes), I'll try it.

@rabah-khalek rabah-khalek disabled auto-merge April 18, 2024 08:02
tool_calls: Optional[list] = None


def _format_message(msg: ChatMessage) -> dict:
Copy link
Contributor

Choose a reason for hiding this comment

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

should be ToolChatMessage type

Copy link
Contributor

Choose a reason for hiding this comment

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

actually for this one, it's ChatMessage, but what GiskardCopilotClient.complete returns is ToolChatMessage

**TALK_CLIENT_CONFIG,
)

if content := response.content:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get the use of walrus here

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah good catch, it would've been useful if these where properties with lazy loading of sorts, but no both of these are just simple attributes. I fixed it.

andreybavt

This comment was marked as resolved.

Copy link
Contributor

@andreybavt andreybavt left a comment

Choose a reason for hiding this comment

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

Generally LGTM, just minor comments

@rabah-khalek rabah-khalek enabled auto-merge (squash) April 18, 2024 10:03
@sonarqubecloud
Copy link

@rabah-khalek rabah-khalek merged commit 960a93c into main Apr 18, 2024
@rabah-khalek rabah-khalek deleted the feature/gsk-2334-talk-to-my-model-mvp branch April 18, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Development

Successfully merging this pull request may close these issues.

6 participants