Skip to content

Commit

Permalink
Add version (#130)
Browse files Browse the repository at this point in the history
Add __version__ and lint
  • Loading branch information
eyurtsev authored Dec 14, 2023
1 parent 8798735 commit 09d2145
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
11 changes: 11 additions & 0 deletions langchain_benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from importlib import metadata

from langchain_benchmarks.model_registration import model_registry
from langchain_benchmarks.rate_limiting import RateLimiter
from langchain_benchmarks.registration import registry
Expand All @@ -6,8 +8,17 @@
download_public_dataset,
)

try:
__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
# Case where package metadata is not available.
__version__ = ""
del metadata # optional, avoids polluting the results of dir(__package__)


# Please keep this list sorted!
__all__ = [
"__version__",
"clone_public_dataset",
"download_public_dataset",
"model_registry",
Expand Down
2 changes: 1 addition & 1 deletion langchain_benchmarks/tool_usage/agents/adapters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Callable, Any
from typing import Any, Callable, Optional

from langchain.agents import AgentExecutor
from langchain_core.runnables import Runnable, RunnableLambda, RunnablePassthrough
Expand Down
4 changes: 2 additions & 2 deletions langchain_benchmarks/tool_usage/agents/experimental/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
from langchain.tools import StructuredTool
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.language_models import BaseChatModel, BaseLanguageModel
from langchain_core.messages import BaseMessage, HumanMessage, AIMessage
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
from langchain_core.prompts import MessagesPlaceholder
from typing_extensions import NotRequired, TypedDict

from langchain_benchmarks import RateLimiter
from langchain_benchmarks.rate_limiting import with_rate_limit
from langchain_benchmarks.tool_usage.agents.experimental.encoder import (
AstPrinter,
FunctionResult,
TypeScriptEncoder,
XMLEncoder,
)
from langchain_benchmarks.tool_usage.agents.experimental.encoder import FunctionResult
from langchain_benchmarks.tool_usage.agents.experimental.prompts import (
_AGENT_INSTRUCTIONS_BLOB_STYLE,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ast
import re
from typing import Union, Dict, Optional
from typing import Dict, Optional, Union

from langchain.agents import AgentOutputParser
from langchain.pydantic_v1 import BaseModel, Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from langchain.tools.base import StructuredTool

from langchain_benchmarks.tool_usage.agents.experimental.encoder import (
Parameter,
FunctionDefinition,
Parameter,
)

# PUBLIC API
Expand Down
1 change: 0 additions & 1 deletion langchain_benchmarks/tool_usage/agents/openai_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from langchain_benchmarks.schema import ToolUsageTask
from langchain_benchmarks.tool_usage.agents.adapters import apply_agent_executor_adapter


# PUBLIC API


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from langchain_core.agents import AgentFinish, AgentActionMessageLog
from langchain_core.agents import AgentActionMessageLog, AgentFinish
from langchain_core.exceptions import OutputParserException
from langchain_core.messages import AIMessage

Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/test_public_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def test_public_api() -> None:
# Please keep it sorted!
assert __all__ == sorted(
[
"__version__",
"clone_public_dataset",
"download_public_dataset",
"model_registry",
Expand Down

0 comments on commit 09d2145

Please sign in to comment.