This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GroqCloud models and groq-sdk dependency
- Loading branch information
Showing
17 changed files
with
417 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
--- | ||
title: GroqCloud models | ||
--- | ||
|
||
# GroqCloud models | ||
POST *https://api.turing.sh/text/groq* | ||
|
||
## Parameters | ||
|
||
|
||
- **messages** | ||
- Type: array | ||
- Required: true | ||
|
||
- **model** | ||
- Type: string | ||
- Required: false | ||
- Options: mixtral-8x7b-32768 | ||
- Default: mixtral-8x7b-32768 | ||
|
||
- **max_tokens** | ||
- Type: number | ||
- Required: false | ||
- Default: 512 | ||
|
||
- **temperature** | ||
- Type: number | ||
- Required: false | ||
- Default: 0.9 | ||
|
||
- **id** | ||
- Type: string | ||
- Required: false | ||
- Description: ID of the conversation (used for data saving) | ||
- Default: 7ab7480c-8e5d-4177-89a1-f90444798ae5 | ||
|
||
## Response | ||
|
||
|
||
- **result** | ||
- Type: string | ||
|
||
- **done** | ||
- Type: boolean | ||
|
||
- **cost** | ||
- Type: number | ||
|
||
- **finishReason** | ||
- Type: string | ||
|
||
- **id** | ||
- Type: string | ||
- Description: ID of the conversation (used for data saving) | ||
|
||
## Examples | ||
|
||
<CodeGroup title="GroqCloud models example"> | ||
```typescript | ||
import axios from "axios"; | ||
(async () => { | ||
let response = await axios({ | ||
method: "post", | ||
url: 'https://api.turing.sh/text/groq', | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer YOUR_API_KEY", | ||
"x-captcha-token": "Captcha key" | ||
}, | ||
data: { | ||
"messages": "array", | ||
"model": "mixtral-8x7b-32768", | ||
"max_tokens": 512, | ||
"temperature": 0.9, | ||
"id": "7ab7480c-8e5d-4177-89a1-f90444798ae5" | ||
}, | ||
}) | ||
})(); | ||
``` | ||
```python | ||
import requests | ||
import json | ||
response = requests.post( | ||
"https://api.turing.sh/text/groq", | ||
headers={ | ||
"Content-Type": "application/json", | ||
"Authorization": "Bearer YOUR_API_KEY", | ||
"x-captcha-token": "Captcha key" | ||
}, | ||
data=json.dumps({ | ||
"messages": "array", | ||
"model": "mixtral-8x7b-32768", | ||
"max_tokens": 512, | ||
"temperature": 0.9, | ||
"id": "7ab7480c-8e5d-4177-89a1-f90444798ae5" | ||
}), | ||
) | ||
``` | ||
</CodeGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.