Skip to content

Commit

Permalink
docs: fixes some doc pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrieh committed May 21, 2024
1 parent bddb585 commit 0136f6d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/pages/docs/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const webRenderer = new WebRenderer();

const sessionKit = new SessionKit(
{
appName: "Effect Network",
appName: "<YOUR APP NAME>",
chains: [eos],
ui: webRenderer,
walletPlugins: [
Expand Down
16 changes: 5 additions & 11 deletions docs/pages/docs/collecting-data/create-a-template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ A typical template will be a HTML file that contains the structure of the tasks.
In this case, we aim to determine whether an image depicts a Chihuahua or a muffin.
Our template should include the following:

- Load an Image: Implement functionality to load images within the campaign interface. Users should be able to view and analyze each image provided.

- HTML Form: Integrate an HTML form into the campaign template. This form will allow annotators to make their selection regarding whether the displayed image is a Chihuahua or a muffin. The form should be user-friendly and intuitive, guiding annotators through the decision-making process.
- **Load an Image**: In order for our workers to distinguish between a Chihuahua or a Muffin, an image must be loaded and displayed to them.
- **HTML Form**: We must integrate an HTML form into the template so our users can fill in whether the loaded image is a Chihuahua or a Muffin.

```html
<html>
<head>
<title>My Image labeling Campaign</title>
<title>Chihuahua or Muffin</title>
</head>
<body>
<form>
<div class="classify-image">
<h1 class="title">Classify The Image</h1>
<!-- The image loaded from IPFS -->
<h1 class="title">Chihuahua or Muffin ?</h1>
<!-- The image loaded from IPFS using a template variable -->
<img src='https://gateway.pinata.cloud/ipfs/${ipfs_url}'/>
</div>
<div class="question question-sentiment">
Expand All @@ -42,11 +41,6 @@ Our template should include the following:
<button type="submit" class="is-large mt-6">Submit</button>
</form>
</body>

<script>
setTimeout(() => console.log(window.FORCE_PLACEHOLDERS), 1000)
</script>

</html>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const campaigns = await getCampaigns({ client });

### 3. Authentication

Depending on your use case, you might need some sort of authentication with the EOS blockchain. Authentication is done through passing a [Wharfkit Session](https://wharfkit.com/kits/session). Read our guide on how to Authentication depending on your environment.
Depending on your use case, you might need some sort of authentication with the EOS blockchain. Authentication is done through passing a [Wharfkit Session](https://wharfkit.com/kits/session). Read our guide on [how authenticate depending on your environment](/docs/authentication).


## What's next ?
Expand Down
50 changes: 32 additions & 18 deletions docs/snippets/tasks/create-campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,36 @@ const session = new Session({

const client = await createClient({ session });
// ---cut---
import { createCampaign, type CreateCampaignArgs } from "@effectai/sdk";
import { createCampaign } from "@effectai/sdk";

const myNewCampaign: CreateCampaignArgs["campaign"] = {
version: 1.0,
maxTaskTime: 100,
reward: 3.5,
title: "My First Campaign!",
description: "Description of the task here.",
instructions: "Some instructions here",
template: "<h1>Template here</h1>",
input_schema: null,
output_schema: null,
image: "",
category: "",
example_task: "",
estimated_time: 10,
};

const campaign = await createCampaign({ client, campaign: myNewCampaign });
const campaign = await createCampaign({
client,
campaign: {
// Name of your campaign
title: "My First Campaign!",
// Description of the campaign
description: "Description of the task here.",
// Campaign version
version: 1.0,
// Maximum time to complete a task in seconds
maxTaskTime: 100,
// EFX reward per task
reward: 3.5,
// Custom instructions for completing tasks in this campaign (Markdown supported)
instructions: "Some instructions here",
// Template of the campaign see https://docs.effect.ai/docs/templates/introduction
template: "<h1>Template here</h1>",
// Input schema to validate the task data.
input_schema: null,
// TODO::
output_schema: null,
// Image URL for the campaign
image: "",
// Category of the campaign
category: "",
// TODO::
example_task: "",
// TODO:: Estimated time to complete a task in this campaign
estimated_time: 10,
},
});

0 comments on commit 0136f6d

Please sign in to comment.