Skip to content

Commit 497c3e4

Browse files
authored
Fix for settings, pass client on patch (#132)
* Fix for settings, pass client on patch * Add correctness metric to RAG eval
1 parent 7d87818 commit 497c3e4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/client/utils/st_common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def patch_settings() -> None:
6363
api_call.patch(
6464
endpoint="v1/settings",
6565
payload={"json": state.user_settings},
66+
params={"client": state.user_settings["client"]},
6667
)
6768
except api_call.ApiError as ex:
6869
logger.error("%s Settings Update failed: %s", state.user_settings["client"], ex)

src/server/endpoints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from langchain_core.messages import HumanMessage, AnyMessage, convert_to_openai_messages, ChatMessage
2222
from langchain_core.runnables import RunnableConfig
2323
from giskard.rag import evaluate, QATestset
24+
from giskard.rag.metrics import correctness_metric
2425
from litellm import APIConnectionError
2526

2627
from fastapi import FastAPI, Header, Query, HTTPException, UploadFile, Response
@@ -897,7 +898,7 @@ def get_answer(question: str):
897898
logger.debug("Starting evaluation with Judge: %s", judge)
898899
oci_config = get_client_oci(client)
899900
judge_client = asyncio.run(models.get_client(MODEL_OBJECTS, {"model": judge}, oci_config, True))
900-
report = evaluate(get_answer, testset=loaded_testset, llm_client=judge_client)
901+
report = evaluate(get_answer, testset=loaded_testset, llm_client=judge_client, metrics=[correctness_metric])
901902

902903
eid = testbed.insert_evaluation(
903904
db_conn=db_conn,

0 commit comments

Comments
 (0)