13P by xguru 3달전 | favorite | 댓글 1개
  • 사람이 문제를 해결하는 방식과 마찬가지로, LLM이 함수를 호출하고 응답에 따라 다음 단계를 지능적으로 선택하여 작업을 수행
  • 사용 방법
    • Assistant 생성
    • Tools(Functions), Knowledge(VectorDB), Storage(DB) 를 추가
    • Streamlit, FastAPI, Django로 서빙하여 AI 애플리케이션 구축

예제 코드대로 하면 너무 잘 동작하는데, 모델을 로컬에서 돌리는 것도 아니고, Open AI API Key가 필요한 것도 아니라서 어떤 LLM을 어떻게 사용하는지 모르겠네요;;

도구도 쉽게 만들 수 있는데, docstring으로 사용법만 알려주면 알아서 잘써서 신기합니다.

def get_html(url: str):  
    """Get the HTML of a webpage.  
  
    Args:  
        url (str): The URL of the webpage.  
  
    Returns:  
        str: The HTML of the webpage.  
    """  
    return get(url).text  
  
  
assistant = Assistant(tools=[get_html], show_tools_calls=True)  
assistant.print_response("`https://news.hada.io/topic?id=13436` 사이트의 내용을 3줄 요약해 주세요.", markdown=True)