LLMCheatsheets.jl 은 GitHub 리포지토리에서 치트시트를 생성하여 AI 모델에 새로운 패키지 및 리포지토리에 대해 쉽고 즉각적으로 가르칠 수 있게 해주는 Julia 패키지입니다. 이 도구는 사람이 읽을 수 있는 문서와 AI 친화적인 지식 표현 간의 격차를 해소하여 언어 모델 및 AI 보조자와 원활하게 통합할 수 있도록 해줍니다.
기본적으로 우리는 제공된 리포지토리에 있는 폴더와 파일의 하위 집합을 가져와서 LLM을 사용하여 단일 치트시트로 요약합니다.
LLMCheatsheets.jl을 설치하려면 Julia 패키지 관리자와 저장소 URL을 사용하세요(아직 등록되지 않음).
using Pkg
Pkg . add (url = " https://github.com/svilupp/LLMCheatsheets.jl " )
팁
GitHub API에 액세스할 때 속도 제한이 발생하는 경우 개인 액세스 토큰을 설정하고 이를 환경 변수 GITHUB_API_KEY
로 설정하여 요청 제한을 시간당 5000으로 늘릴 수 있습니다.
다음은 LLMCheatsheets.jl을 사용하여 GitHub 저장소용 치트시트를 만드는 방법에 대한 기본 예입니다.
using LLMCheatsheets
repo = GitHubRepo ( " https://github.com/svilupp/PromptingTools.jl " )
create_cheatsheet (repo; save_path = true );
save_path = true
사용하면 치트시트가 현재 작업 디렉터리의 llm-cheatsheets
폴더에 저장됩니다.
뒤에서 무슨 일이 일어나는지:
repo.paths
및 repo.file_types
와 일치하는 모든 관련 파일을 찾기 위해 저장소를 스캔합니다. 파일을 개별적으로 생성하고 직접 처리하는 저수준 인터페이스에 대해서는 examples/create_for_promptingtools.jl
참조하세요.
때로는 파일을 요약하지 않고 파일만 다운로드하고 싶을 수도 있습니다. collect
기능을 사용하면 그렇게 할 수 있습니다.
files_str = collect (repo)
files_str
스캔된 모든 파일이 함께 연결된 문자열입니다. ChatGPT 또는 Claude.ai에서 사용하려면 clipboard
기능을 사용하여 클립보드에 복사하세요( files_str|>clipboard
.
기본적으로 스캔되고 다운로드되는 파일은 각각 repo.paths
및 repo.file_types
입니다.
기본적으로 repo.paths
["src", "docs/src", "README.md"]
포함되고 repo.file_types
에는 [".jl", ".md"]
가 포함됩니다. GitHubRepo
객체를 생성할 때 다음을 사용자 정의할 수 있습니다.
예를 들어 폴더 examples
와 .txt
파일을 추가하여 요약할 내용을 사용자 정의합니다.
repo = GitHubRepo ( " https://github.com/username/repository " ; paths = [ " examples " , " README.md " ], file_types = [ " .jl " , " .md " , " .txt " ])
model
인수를 함수에 전달하여 다른 LLM을 사용할 수 있습니다.
create_cheatsheet (repo; save_path = true , model = " gpt4om " )
치트시트 생성 시 AI를 안내하는 특별 지침을 제공할 수 있습니다.
create_cheatsheet (repo; special_instructions = " Focus on the data structures and their interactions. " )
PromptingTools.jl에서 ai* 기능을 내보내어 LLMCheatsheets.jl과 함께 사용할 수도 있습니다.
using LLMCheatsheets
# Re-export aigenerate, pprint from PromptingTools
using LLMCheatsheets : aigenerate, pprint
# Or import PromptingTools directly
# using PromptingTools
repo = GitHubRepo ( " https://github.com/svilupp/PromptingTools.jl " ; paths = [ " docs/src " , " README.md " ])
files_str = collect (repo)
msg = aigenerate ( " Read through these files: $(files_str) nn Answer the question: What is the function for creating prompt templates? " )
pprint (msg)
The function for creating prompt templates in the `PromptingTools.jl` package is `create_template`. This function allows you to define a prompt with placeholders and save it for later use. The syntax is:
```julia
create_template(; user=<user prompt>,
system=<system prompt>, load_as=<template name>)
```
This function generates a vector of messages, which you can use directly in the `ai*` functions. If you provide the `load_as` argument, it will also register the template in the template store,
allowing you to access it later using its name.
LLM 제공업체에 의해 속도가 제한되는 경우 ntasks=5
또는 ntasks=2
(API 계층에 따라 다름)와 같이 더 낮은 숫자를 설정하여 create_cheatsheet
에서 동시 요약 작업 수를 줄일 수 있습니다.
개인 액세스 토큰을 설정하고 ENV["GITHUB_API_KEY"]
로 설정합니다. LLMCheatsheets.GITHUB_API_KEY
변수에 자동으로 로드됩니다.
다음 단계에 따라 GitHub API에 대한 개인 액세스 토큰을 설정할 수 있습니다.
그런 다음 ENV["GITHUB_API_KEY"]
또는 LLMCheatsheets.GITHUB_API_KEY
로 설정할 수 있습니다.
LLMCheatsheets.jl 사용에 대한 자세한 내용은 설명서를 참조하세요.
문제가 발생하거나 질문이 있는 경우 GitHub 저장소에서 문제를 열어주세요.