Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8580e8e
first draft
GTimothee Apr 7, 2025
75db905
tmp change for test
GTimothee Apr 7, 2025
9f5e454
tmp change for test
GTimothee Apr 7, 2025
1ebc028
update tags in template, litlle updates in the testset class
GTimothee Apr 8, 2025
1f12a0c
add get_config usage in llmclient
GTimothee Apr 8, 2025
f054c3e
fix little inconsistency with get_config
GTimothee Apr 8, 2025
bb656bd
add unit tests
GTimothee Apr 8, 2025
be6e661
update tests
GTimothee Apr 8, 2025
1d6cc7f
update tests
GTimothee Apr 8, 2025
41acbce
update tests
GTimothee Apr 8, 2025
e007e91
test get_config for litellm
GTimothee Apr 8, 2025
1e5a580
fix test get_config for litellm
GTimothee Apr 8, 2025
632b939
fix test get_config for other llm
GTimothee Apr 8, 2025
7b9d58d
fix test get_config for mistralllm
GTimothee Apr 8, 2025
23fe214
add documentation
GTimothee Apr 8, 2025
1c0edea
pdm lock updated
GTimothee Apr 9, 2025
2da300e
add API reference
GTimothee Apr 9, 2025
b80d2b4
update method names + add logo to card template
GTimothee Apr 11, 2025
87920d6
merge updated main
GTimothee Apr 11, 2025
7e79f75
fixed test - tests passing
GTimothee Apr 11, 2025
b6e5739
update pdm.lock
GTimothee Apr 11, 2025
9893f13
isort - black
GTimothee Apr 11, 2025
e4134f8
update pdm.lock
henchaves Apr 11, 2025
0d1638f
small fix for backward compatibility
GTimothee Apr 15, 2025
ddf00fb
Merge branch 'main' into qatest_push_to_hub
davidberenstein1957 Apr 16, 2025
ce1d60c
Merge branch 'main' into qatest_push_to_hub
davidberenstein1957 Apr 22, 2025
4457516
fix workflow for testing pydantic v1
Apr 28, 2025
7763077
Update QATestset.md
davidberenstein1957 Jun 11, 2025
2f62912
Update build-python.yml
davidberenstein1957 Jun 11, 2025
460fd27
Delete pdm.lock
davidberenstein1957 Jun 11, 2025
eea7afd
update pdm.lock
henchaves Jun 11, 2025
085abe6
Merge branch 'main' into qatest_push_to_hub
henchaves Jun 11, 2025
e7e4aaa
Update testset.py
davidberenstein1957 Jun 11, 2025
86ebea5
Update testset.py
davidberenstein1957 Jun 11, 2025
dc0596c
Update testset.py
davidberenstein1957 Jun 11, 2025
cb74007
Update giskard/rag/testset.py
davidberenstein1957 Jun 11, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix little inconsistency with get_config
  • Loading branch information
GTimothee committed Apr 8, 2025
commit f054c3e00f1dd2f7b50274753dfe642829c40214
6 changes: 6 additions & 0 deletions giskard/llm/client/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def complete(

return self._parse_completion(completion, caller_id)

def get_config(self) -> dict:
"""Return the configuration of the LLM client."""
return {
"client_type": self.__class__.__name__,
"model": self.model
}

@deprecated("ClaudeBedrockClient is deprecated: https://docs.giskard.ai/en/latest/open_source/setting_up/index.html")
class ClaudeBedrockClient(BaseBedrockClient):
Expand Down
7 changes: 7 additions & 0 deletions giskard/llm/client/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ def __init__(self, model: str = "gemini-pro", _client=None):
self.model = model
self._client = _client or genai.GenerativeModel(self.model)

def get_config(self) -> dict:
"""Return the configuration of the LLM client."""
return {
"client_type": self.__class__.__name__,
"model": self.model
}

def complete(
self,
messages: Sequence[ChatMessage],
Expand Down
1 change: 1 addition & 0 deletions giskard/llm/client/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def complete(
def get_config(self) -> dict:
"""Return the configuration of the LLM client."""
return {
"client_type": self.__class__.__name__,
"model": self.model,
"disable_structured_output": self.disable_structured_output,
"completion_params": self.completion_params,
Expand Down
7 changes: 7 additions & 0 deletions giskard/llm/client/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ def __init__(self, model: str = "mistral-large-latest", client: Mistral = None):
self.model = model
self._client = client or Mistral(api_key=os.getenv("MISTRAL_API_KEY", ""))

def get_config(self) -> dict:
"""Return the configuration of the LLM client."""
return {
"client_type": self.__class__.__name__,
"model": self.model
}

def complete(
self,
messages: Sequence[ChatMessage],
Expand Down
8 changes: 8 additions & 0 deletions giskard/llm/client/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def __init__(
self._client = client or openai.OpenAI()
self.json_mode = json_mode if json_mode is not None else _supports_json_format(model)

def get_config(self) -> dict:
"""Return the configuration of the LLM client."""
return {
"client_type": self.__class__.__name__,
"model": self.model,
"json_mode": self.json_mode,
}

def complete(
self,
messages: Sequence[ChatMessage],
Expand Down
7 changes: 1 addition & 6 deletions giskard/rag/testset.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,7 @@ def push_to_hub(
template = template_path.read_text()

# Make and push the dataset card
llm_client = get_default_client()
if not hasattr(llm_client, "get_config") or not callable(getattr(llm_client, "get_config")):
logging.warning(f"The 'get_config' abstract method has not been implemented for {type(llm_client)}. Configuration is empty.")
config = {}
else:
config = {"metadata": llm_client.get_config()}
config = {"metadata": get_default_client().get_config()}
content = template.format(repo_id=repo_id, num_items=len(self._dataframe), config=json.dumps(config, indent=4))
return DatasetCard(content=content).push_to_hub(repo_id=repo_id, token=token, repo_type="dataset")

Expand Down