Conversation
graphrag_eval/evaluation.py
Outdated
| from pydantic import BaseModel, Field, model_validator | ||
|
|
||
| from . import custom_evaluation | ||
| from . import llm as llm_ |
There was a problem hiding this comment.
why do we rename llm to llm_?
There was a problem hiding this comment.
Otherwise defining class Config field llm gives error 'Type of "llm" could not be determined because it refers to itself'.
There was a problem hiding this comment.
I would suggest then to rename the field llm in the Config class to llm_config or something. I don't like the underscore. The readability is not good.
There was a problem hiding this comment.
I don't like llm_config. Renamed the imported class instead.
| class Config(BaseModel): | ||
| name: str | ||
| temperature: float = Field(ge=0.0, le=1.0) | ||
| max_tokens: int = Field(ge=1) |
There was a problem hiding this comment.
If we merge #47 first, this should be removed, right? Also, we should introduce an embeddings model for answer relevancy, right https://github.com/Ontotext-AD/graphrag-eval/pull/47/changes#diff-f3dd3002658ae3670117b3df5ee6937158b2fad7c1543420fc25ccae901bfe24R9 ?
There was a problem hiding this comment.
Of course! After one of these PRs is merged, the other has to be rebased and re-reviewed. Feel free to pause reviewing one of these until the other is merged and rebased.
There was a problem hiding this comment.
We still have this field. What is the purpose of it?
There was a problem hiding this comment.
See section Configuration: "maximum number of tokens to generate"
graphrag_eval/llm.py
Outdated
| def call(config: Config, prompt: str) -> str: | ||
| import litellm | ||
| try: | ||
| response = litellm.completions( |
There was a problem hiding this comment.
There was a problem hiding this comment.
Did you poetry install --with llm?
Now linked LiteLLM documentation from the description.
It seems that there are many optional params that differ between agent/model types and providers. For providers whose name starts with either 'A' or 'B', I found:
temperaturetop_papi_baseapi_versionreasoning_effortreasoningverbositytoolstool_choicemax_output_tokensresponse_formatenforce_validationthinkingvertex_projectvertex_locationvertex_credentialsuse_psc_endpoint_formatextra_headersparallel_tool_callsaws_access_key_idaws_secret_access_keyaws_session_nameaws_session_tokenaws_region_nameaws_profile_nameaws_role_nameaws_web_identity_tokenaws_bedrock_runtime_endpointapi_keymax_tokens
I modified the PR to expect name, temperature and max_tokens and use where them when appropriate, and pass all params to litellm.completions().
There was a problem hiding this comment.
My IDE is complaining that it can't find reference to this function
Good catch: it'scompletion().
warning that .dict() is deprectated
Changed to.model_dump().
README.md
Outdated
| * `temperature`: (float in the range [0.0, 2.0]) adversarial temperature for generation | ||
| * `max_tokens`: (int > 0) maximum number of tokens to generate | ||
| * Optional keys: parameters to be passed to LiteLLM for generation (for (`answer_correctness`)[#output-keys] and (custom evaluation)[#custom-evaluation-(custom-metrics)]) | ||
| * `embedding`: required for (`answer_relevance`)[#output-keys]. |
There was a problem hiding this comment.
the link is not rendered as one
README.md
Outdated
| * `embedding`: required for (`answer_relevance`)[#output-keys]. | ||
| * `provider`: (str) name of the organiation providing the embedding model | ||
| * `model`: (str) name of the embedding model | ||
| * `custom_evaluations`: (list of the following maps) required nonempty for (custom evaluation)[#custom-evaluation-(custom-metrics)]. Each map has keys: |
There was a problem hiding this comment.
the link is not rendered as one
README.md
Outdated
|
|
||
| #### Example Configuration File With LLM Configuration | ||
|
|
||
| Below is a YAML file that configures the LLM generation ((for metrics that require an LLM)[#llm-use-in-evaluation]) and embedding (for (answer relevance)[#otuput-keys]). |
There was a problem hiding this comment.
the links are not rendered as such
|
8b05abe to
caf2862
Compare
cef58eb to
746fa65
Compare
Not sure how they got removed / how tests were passing before


Modify the configuration file to specify LLM details using the
litellmlibrary. If parameterconfig_file_pathis not specified or the file does not contain the keyllm, the metrics that require an LLM are skipped.We change the code to receive LLM parameters from the top-level function.