-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #630 from Clarifai/alfrick-branch
added test doc
- Loading branch information
Showing
8 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,68 @@ | ||
--- | ||
description: Capture information from an organization's form that are stored as PDF documents | ||
pagination_next: null | ||
sidebar_position: 7 | ||
unlisted: true | ||
--- | ||
|
||
Test document | ||
|
||
|
||
|
||
<!--index.html file--> | ||
|
||
<script> | ||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// In this section, we set the user authentication, user and app ID, model details, and the URL | ||
// of the image we want as an input. Change these strings to run your own example. | ||
////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
// Your PAT (Personal Access Token) can be found in the Account's Security section | ||
const PAT = 'ea5e64be6120415cba71e20b47dc8bbe'; | ||
// Specify the correct user_id/app_id pairings | ||
// Since you're making inferences outside your app's scope | ||
const USER_ID = 'clarifai'; | ||
const APP_ID = 'main'; | ||
// Change these to whatever model and image URL you want to use | ||
const MODEL_ID = 'general-image-recognition'; | ||
const MODEL_VERSION_ID = 'aa7f35c01e0642fda5cf400f543e7c40'; | ||
const IMAGE_URL = 'https://samples.clarifai.com/metro-north.jpg'; | ||
|
||
/////////////////////////////////////////////////////////////////////////////////// | ||
// YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE TO RUN THIS EXAMPLE | ||
/////////////////////////////////////////////////////////////////////////////////// | ||
|
||
const raw = JSON.stringify({ | ||
"user_app_id": { | ||
"user_id": USER_ID, | ||
"app_id": APP_ID | ||
}, | ||
"inputs": [ | ||
{ | ||
"data": { | ||
"image": { | ||
"url": IMAGE_URL | ||
} | ||
} | ||
} | ||
] | ||
}); | ||
|
||
const requestOptions = { | ||
method: 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Authorization': 'Key ' + PAT | ||
}, | ||
body: raw | ||
}; | ||
|
||
// NOTE: MODEL_VERSION_ID is optional, you can also call prediction with the MODEL_ID only | ||
// https://api.clarifai.com/v2/models/{YOUR_MODEL_ID}/outputs | ||
// this will default to the latest version_id | ||
|
||
fetch("https://api.clarifai.com/v2/models/" + MODEL_ID + "/versions/" + MODEL_VERSION_ID + "/outputs", requestOptions) | ||
.then(response => response.text()) | ||
.then(result => console.log(result)) | ||
.catch(error => console.log('error', error)); | ||
</script> |
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,48 @@ | ||
--- | ||
description: Track what has been performed, by whom and with which results | ||
pagination_prev: null | ||
pagination_next: null | ||
draft: true | ||
--- | ||
|
||
# Audit Logging | ||
|
||
**Track what has been performed, by whom and with which results** | ||
<hr /> | ||
|
||
|
||
Audit Logging | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
import CodeBlock from "@theme/CodeBlock"; | ||
|
||
import PythonAudit1 from "!!raw-loader!../../../code_snippets/api-guide/audit-log/audit-1.py"; | ||
import NodeAudit1 from "!!raw-loader!../../../code_snippets/api-guide/audit-log/audit-1.js"; | ||
import JavaAudit1 from "!!raw-loader!../../../code_snippets/api-guide/audit-log/audit-1.java"; | ||
import PHPAudit1 from "!!raw-loader!../../../code_snippets/api-guide/audit-log/audit-1.php"; | ||
import CURLAudit1 from "!!raw-loader!../../../code_snippets/api-guide/audit-log/audit-1.sh"; | ||
|
||
|
||
<Tabs> | ||
<TabItem value="python" label="Python"> | ||
<CodeBlock className="language-python">{PythonAudit1}</CodeBlock> | ||
</TabItem> | ||
|
||
<TabItem value="nodejs" label="NodeJS"> | ||
<CodeBlock className="language-javascript">{NodeAudit1}</CodeBlock> | ||
</TabItem> | ||
|
||
<TabItem value="java" label="Java"> | ||
<CodeBlock className="language-java">{JavaAudit1}</CodeBlock> | ||
</TabItem> | ||
|
||
<TabItem value="php" label="PHP"> | ||
<CodeBlock className="language-php">{PHPAudit1}</CodeBlock> | ||
</TabItem> | ||
|
||
<TabItem value="curl" label="cURL"> | ||
<CodeBlock className="language-bash">{CURLAudit1}</CodeBlock> | ||
</TabItem> | ||
|
||
</Tabs> |
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,6 @@ | ||
{ | ||
"label": "Audit Logging", | ||
"position": 9.2, | ||
"collapsible": true, | ||
"collapsed": true, | ||
} |