Add Tags for LLMs (#6229)

- [x] Add tracing tags to LLMs + Chat Models (both inheritable and
local)
- [x] Add tags for the run_on_dataset helper function(s)
This commit is contained in:
Zander Chase
2023-06-15 11:24:11 -07:00
committed by GitHub
parent 8e1a7a8646
commit ae76e473e1
5 changed files with 109 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
"""Test the LangChain+ client."""
import uuid
from datetime import datetime
from typing import Any, Dict, List, Union
from typing import Any, Dict, List, Optional, Union
from unittest import mock
import pytest
@@ -170,6 +170,7 @@ async def test_arun_on_dataset(monkeypatch: pytest.MonkeyPatch) -> None:
llm_or_chain: Union[BaseLanguageModel, Chain],
n_repetitions: int,
tracer: Any,
tags: Optional[List[str]] = None,
) -> List[Dict[str, Any]]:
return [
{"result": f"Result for example {example.id}"} for _ in range(n_repetitions)