Skip to content

Commit

Permalink
fix(precommit):
Browse files Browse the repository at this point in the history
  • Loading branch information
msoedov committed Jul 12, 2023
1 parent 0a017e0 commit f34a29a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/ex5.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
prompt = ChatPromptTemplate.from_messages(
[
SystemMessagePromptTemplate.from_template(
"The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know."
"The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know." # noqa
),
MessagesPlaceholder(variable_name="history"),
HumanMessagePromptTemplate.from_template("{input}"),
Expand Down
5 changes: 2 additions & 3 deletions examples/ex7_agent.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from langchain import LLMMathChain
from langchain.agents.tools import Tool
from langchain.chat_models import ChatOpenAI
from langchain.experimental.plan_and_execute import (
PlanAndExecute,
load_agent_executor,
load_chat_planner,
)
from langchain.llms import OpenAI
from langchain.agents.tools import Tool
from langchain import LLMMathChain


llm = OpenAI(temperature=0)
llm_math_chain = LLMMathChain.from_llm(llm=llm, verbose=True)
Expand Down
1 change: 1 addition & 0 deletions langcorn/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import fire
import uvicorn

from langcorn.server import api


Expand Down
2 changes: 1 addition & 1 deletion langcorn/server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def create_service(*lc_apps, auth_token: str = "", app: FastAPI = None):
inn, out = derive_fields(chain)
logger.debug(f"inputs:{inn=}")
logger.info(f"{lang_app=}:{chain.__class__.__name__}({inn})")
endpoint_prefix = lang_app.replace(":", '.')
endpoint_prefix = lang_app.replace(":", ".")
cls_name = "".join([c.capitalize() for c in endpoint_prefix.split(".")])
request_cls = derive_class(cls_name, inn, add_memory=chain.memory)
logger.debug(f"{request_cls=}")
Expand Down
5 changes: 3 additions & 2 deletions langcorn/server/test_api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from unittest.mock import MagicMock, patch
from unittest.mock import patch

import pytest
from examples import app
from fastapi.testclient import TestClient
from langchain.llms.fake import FakeListLLM

from examples import app

from .api import create_service

client = TestClient(create_service("examples.ex1:chain"))
Expand Down

0 comments on commit f34a29a

Please sign in to comment.