어시스턴트
- OpenAI의 Assistants API에는 전용 endpoint가 있습니다.
- Assistants API는 코드 인터프리터, 파일 지식 검색, 함수 실행과 같은 기능을 제공하여 AI 어시스턴트를 생성할 수 있게 합니다.
- 이 기능에 대한 심층적인 문서, 작동 방식 및 기능에 대해 여기에서 읽어보세요.
- 일반 OpenAI API와 마찬가지로, **https://platform.openai.com/account/api-keys**로 이동하여 키를 받으세요.
- 다음 환경 변수를 귀하의 키로 설정해야 하며, 사용자가 직접 키를 제공하도록 하려면
user_provided로 설정할 수 있습니다.
ASSISTANTS_API_KEY=your-keyASSISTANTS_MODELS를 사용하여 사용 가능한 모델을 결정할 수 있습니다. 그렇지 않으면 OpenAI에서 가져온 모델 목록이 사용됩니다(Assistants API와 호환되는 모델만 표시됩니다).
ASSISTANTS_MODELS=gpt-3.5-turbo-0125,gpt-3.5-turbo-16k-0613,gpt-3.5-turbo-16k,gpt-3.5-turbo,gpt-4,gpt-4-0314,gpt-4-32k-0314,gpt-4-0613,gpt-3.5-turbo-0613,gpt-3.5-turbo-1106,gpt-4-0125-preview,gpt-4-turbo-preview,gpt-4-1106-preview- 필요한 경우,
OPENAI_REVERSE_PROXY와 유사한ASSISTANTS_BASE_URL을 사용하여 공식 URL 대신 대체 기본 URL을 설정할 수도 있습니다.
ASSISTANTS_BASE_URL=http://your-alt-baseURL:3080/- 필요에 따라 어시스턴트 빌더 UI 비활성화와 같은 추가적인 선택적 구성이 있으며, 이는
librechat.yaml사용자 지정 구성 파일을 통해 설정할 수 있습니다:
엄격한 함수 호출(Strict function calling)
LibreChat에서는 actions를 위한 openapi spec의 operation 수준에서 'x-strict': true 플래그를 추가할 수 있습니다. 이렇게 하면 'strict' 모드가 활성화된 함수 호출이 자동으로 생성됩니다. strict 모드는 JSON의 일부 하위 집합만 지원한다는 점에 유의하세요. 자세한 내용은 https://platform.openai.com/docs/guides/structured-outputs 에서 확인하시기 바랍니다.
예를 들어:
{
"openapi": "3.1.0",
"info": {
"title": "Math.js API",
"description": "API for performing mathematical operations, such as addition, subtraction, etc.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.mathjs.org/v4"
}
],
"paths": {
"/": {
"post": {
"summary": "Evaluate a mathematical expression",
"description": "Sends a mathematical expression in the request body to evaluate.",
"operationId": "math",
"x-strict": true,
"parameters": [
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"expr": {
"type": "string",
"description": "The mathematical expression to evaluate (e.g., `2+3`)."
}
},
"required": ["expr"]
}
}
}
},
"responses": {
"200": {
"description": "The result of the evaluated expression.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "number",
"description": "The evaluated result of the expression."
}
}
}
}
}
},
"400": {
"description": "Invalid expression provided.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message describing the invalid expression."
}
}
}
}
}
}
}
}
}
}
}참고 사항
참고:
- 이 글을 작성하는 시점 기준으로, 다음 모델들만이 Retrieval 기능을 지원합니다:
- gpt-3.5-turbo-0125
- gpt-4-0125-preview
- gpt-4-turbo-preview
- gpt-4-1106-preview
- gpt-3.5-turbo-1106
- Vision 기능은 아직 지원되지 않습니다.
- 이전에 .env 파일의
ENDPOINTS값을 설정한 적이 있다면,assistants값을 추가해야 합니다.
이 가이드는 어떤가요?