Tensorlake는 비정형 소스의 데이터를 AI 애플리케이션을 위한 수집 준비 형식으로 안정적으로 변환하는 AI Data Cloud입니다. langchain-tensorlake 패키지는 TensorlakeLangChain 간의 원활한 통합을 제공하여, 서명 감지와 같은 향상된 파싱 기능을 갖춘 정교한 문서 처리 에이전트를 구축할 수 있게 해줍니다.

Tensorlake 기능 개요

Tensorlake는 다음과 같은 도구를 제공합니다:
  • Extract: 문서에서 특정 필드를 추출하기 위한 스키마 기반 구조화된 데이터 추출.
  • Parse: RAG/Knowledge Graph 시스템을 구축하기 위해 문서를 markdown으로 변환.
  • Orchestrate: 문서, 텍스트, 오디오, 비디오 등의 대규모 수집 및 보강을 위한 프로그래밍 가능한 워크플로우 구축.
자세한 내용은 docs.tensorlake.ai에서 확인하세요

Installation

pip install -U langchain-tensorlake

Examples

langchain-tensorlake 도구를 사용하여 비정형 문서에서 서명을 감지하는 방법에 대한 전체 튜토리얼을 따라해보세요. 또는 빠른 시작을 위해 이 colab notebook을 확인하세요.

Quick Start

1. 환경 설정

다음 환경 변수를 설정하여 Tensorlake와 OpenAI에 대한 자격 증명을 구성해야 합니다:
export TENSORLAKE_API_KEY="your-tensorlake-api-key"
export OPENAI_API_KEY = "your-openai-api-key"
Tensorlake Cloud Console에서 Tensorlake API key를 받으세요. 신규 사용자는 100개의 무료 크레딧을 받습니다.

2. 필요한 패키지 import

from langchain_tensorlake import document_markdown_tool
from langchain.agents import create_agent
import asyncio
import os

3. Signature Detection Agent 구축

async def main(question):
    # Create the agent with the Tensorlake tool
    agent = create_agent(
            model="openai:gpt-4o-mini",
            tools=[document_markdown_tool],
            prompt=(
                """
                I have a document that needs to be parsed. \n\nPlease parse this document and answer the question about it.
                """
            ),
            name="real-estate-agent",
        )

    # Run the agent
    result = await agent.ainvoke({"messages": [{"role": "user", "content": question}]})

    # Print the result
    print(result["messages"][-1].content)
참고: 에이전트가 올바른 파싱 파라미터를 설정할 수 있도록 에이전트 모델로 openai를 사용하는 것을 강력히 권장합니다

4. 사용 예제

# Define the path to the document to be parsed
path = "path/to/your/document.pdf"

# Define the question to be asked and create the agent
question = f"What contextual information can you extract about the signatures in my document found at {path}?"

if __name__ == "__main__":
    asyncio.run(main(question))

도움이 필요하신가요?

Slack이나 GitHub의 패키지 저장소를 통해 직접 문의하세요.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I