mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 23:54:14 +00:00
Permit function eval on llm data type (#19287)
This commit is contained in:
parent
f8078e41e5
commit
89af30807b
@ -9,7 +9,6 @@ import inspect
|
|||||||
import logging
|
import logging
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from enum import Enum
|
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING,
|
TYPE_CHECKING,
|
||||||
Any,
|
Any,
|
||||||
@ -430,13 +429,6 @@ def _setup_evaluation(
|
|||||||
run_type = "llm"
|
run_type = "llm"
|
||||||
else:
|
else:
|
||||||
run_type = "chain"
|
run_type = "chain"
|
||||||
if data_type in (DataType.chat, DataType.llm):
|
|
||||||
val = data_type.value if isinstance(data_type, Enum) else data_type
|
|
||||||
raise ValueError(
|
|
||||||
"Cannot evaluate a chain on dataset with "
|
|
||||||
f"data_type={val}. "
|
|
||||||
"Please specify a dataset with the default 'kv' data type."
|
|
||||||
)
|
|
||||||
chain = llm_or_chain_factory()
|
chain = llm_or_chain_factory()
|
||||||
run_inputs = chain.input_keys if isinstance(chain, Chain) else None
|
run_inputs = chain.input_keys if isinstance(chain, Chain) else None
|
||||||
run_outputs = chain.output_keys if isinstance(chain, Chain) else None
|
run_outputs = chain.output_keys if isinstance(chain, Chain) else None
|
||||||
|
Loading…
Reference in New Issue
Block a user