Skip to content

Commit

Permalink
Merge pull request #630 from Clarifai/alfrick-branch
Browse files Browse the repository at this point in the history
added test doc
  • Loading branch information
Alfrick authored Jan 16, 2025
2 parents 238e1ba + f692a4f commit 0336268
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
68 changes: 68 additions & 0 deletions docs/api-guide/advanced-topics/test.md
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>
48 changes: 48 additions & 0 deletions docs/api-guide/audit-log/README.mdx
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>
6 changes: 6 additions & 0 deletions docs/api-guide/audit-log/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "Audit Logging",
"position": 9.2,
"collapsible": true,
"collapsed": true,
}

0 comments on commit 0336268

Please sign in to comment.