Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbeevip committed Jul 4, 2024
1 parent 9497c7f commit 9449ef0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/langchain_lab/core/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
def openai_speech_to_text(audio_file_path):
client = OpenAI(base_url=os.environ["OPENAI_API_BASE"], api_key=os.environ["OPENAI_API_KEY"])
audio_file = open(audio_file_path, "rb")
transcription = client.audio.transcriptions.create(
model="whisper-1",
file=audio_file
)
transcription = client.audio.transcriptions.create(model="whisper-1", file=audio_file)
print(transcription.text)
1 change: 0 additions & 1 deletion src/langchain_lab/core/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from langchain_community.embeddings import HuggingFaceEmbeddings, OpenAIEmbeddings
from langchain_community.vectorstores import FAISS


from langchain_lab import logger


Expand Down
1 change: 0 additions & 1 deletion src/langchain_lab/core/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from langchain.chat_models.base import BaseChatModel
from langchain.schema import LLMResult
from langchain_openai import ChatOpenAI

from openai import OpenAI

from langchain_lab import logger
Expand Down
4 changes: 4 additions & 0 deletions src/langchain_lab/scenarios/agents/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from langchain_lab.core.agents import agent_register
from langchain_lab.scenarios.agents.langgraph_agent.langgraph_demo_agent import (
LangGraphDemoAgent,
)
from langchain_lab.scenarios.agents.translation_agent.translation_english2chinese import (
TranslationEnglish2Chinese,
)
Expand All @@ -8,3 +11,4 @@

agent_register(WikipediaAgent())
agent_register(TranslationEnglish2Chinese())
agent_register(LangGraphDemoAgent())
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Any, Dict

from langchain_lab.core.agents import LabAgent


class LangGraphDemoAgent(LabAgent):
description = "这是一个演示 LangGraph 的 Agent"

def agent_invoke(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
return {"input": inputs, "output": "hello world"}

0 comments on commit 9449ef0

Please sign in to comment.