mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-16 06:16:57 +00:00
add docstring for /embeddings and /completions
This commit is contained in:
@@ -3294,6 +3294,24 @@ async def completion(
|
||||
model: Optional[str] = None,
|
||||
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
|
||||
):
|
||||
"""
|
||||
Follows the exact same API spec as `OpenAI's Completions API https://platform.openai.com/docs/api-reference/completions`
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:4000/v1/completions \
|
||||
|
||||
-H "Content-Type: application/json" \
|
||||
|
||||
-H "Authorization: Bearer sk-1234" \
|
||||
|
||||
-d '{
|
||||
"model": "gpt-3.5-turbo-instruct",
|
||||
"prompt": "Once upon a time",
|
||||
"max_tokens": 50,
|
||||
"temperature": 0.7
|
||||
}'
|
||||
```
|
||||
"""
|
||||
global user_temperature, user_request_timeout, user_max_tokens, user_api_base
|
||||
data = {}
|
||||
try:
|
||||
@@ -3500,6 +3518,23 @@ async def embeddings(
|
||||
model: Optional[str] = None,
|
||||
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
|
||||
):
|
||||
"""
|
||||
Follows the exact same API spec as `OpenAI's Embeddings API https://platform.openai.com/docs/api-reference/embeddings`
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:4000/v1/embeddings \
|
||||
|
||||
-H "Content-Type: application/json" \
|
||||
|
||||
-H "Authorization: Bearer sk-1234" \
|
||||
|
||||
-d '{
|
||||
"model": "text-embedding-ada-002",
|
||||
"input": "The quick brown fox jumps over the lazy dog"
|
||||
}'
|
||||
```
|
||||
|
||||
"""
|
||||
global proxy_logging_obj
|
||||
data: Any = {}
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user