Wikis
List Wikis
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.list(factory_id="<factory_id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.list({ factoryId: "<factory_id>" });
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
"repository_key": Optional[str],
"branch": Optional[str],
"factory_id": Optional[str],
}
{
limit?: number;
startingAfter?: string;
endingBefore?: string;
repositoryKey?: string;
branch?: string;
factoryId?: string;
}
Show Response
Show Response
{
"data": [{ # optional
"wiki_id": Optional[str],
"workspace_id": Optional[str],
"created_by_id": Optional[str],
"display_name": Optional[str],
"repository_key": Optional[str],
"repository": { # optional
"provider": Optional[str],
"owner": Optional[str],
"name": Optional[str],
"url": Optional[str],
"default_branch": Optional[str],
},
"branch": Optional[str],
"scm_connection_id": Optional[str],
"settings": { # optional
"model": Optional[str],
"computer_template": Optional[str],
"depth": Optional[str],
"refresh_cadence": Optional[str],
"publish_to_repository": Optional[bool],
},
"loop_id": Optional[str],
"status": Optional[str],
"current_run_id": Optional[str],
"last_generated_commit": Optional[str],
"last_generated_at": str, # optional
"page_count": Optional[int],
"created_at": str, # optional
"updated_at": str, # optional
"factory_id": Optional[str],
}],
"has_more": Optional[bool],
}
{
data?: {
wikiId?: string;
workspaceId?: string;
createdById?: string;
displayName?: string;
repositoryKey?: string;
repository?: {
provider?: string;
owner?: string;
name?: string;
url?: string;
defaultBranch?: string;
};
branch?: string;
scmConnectionId?: string;
settings?: {
model?: string;
computerTemplate?: string;
depth?: string;
refreshCadence?: string;
publishToRepository?: boolean;
};
loopId?: string;
status?: string;
currentRunId?: string;
lastGeneratedCommit?: string;
lastGeneratedAt?: Date;
pageCount?: number;
createdAt?: Date;
updatedAt?: Date;
factoryId?: string;
}[];
hasMore?: boolean;
}
Create a Wiki
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.create(display_name="Product handbook", factory_id="<factory_id>", repository={"url": "https://github.com/orq-ai/orq-cookbooks"}, branch="main", scm_connection_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.create({
displayName: "Product handbook",
factoryId: "<factory_id>",
repository: { url: "https://github.com/orq-ai/orq-cookbooks" },
branch: "main",
scmConnectionId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"display_name": Optional[str],
"repository": { # optional
"provider": Optional[str],
"owner": Optional[str],
"name": Optional[str],
"url": Optional[str],
"default_branch": Optional[str],
},
"branch": Optional[str],
"scm_connection_id": Optional[str],
"settings": { # optional
"model": Optional[str],
"computer_template": Optional[str],
"depth": Optional[str],
"refresh_cadence": Optional[str],
"publish_to_repository": Optional[bool],
},
"import_existing": Optional[bool],
"factory_id": Optional[str],
}
{
displayName?: string;
repository?: {
provider?: string;
owner?: string;
name?: string;
url?: string;
defaultBranch?: string;
};
branch?: string;
scmConnectionId?: string;
settings?: {
model?: string;
computerTemplate?: string;
depth?: string;
refreshCadence?: string;
publishToRepository?: boolean;
};
importExisting?: boolean;
factoryId?: string;
}
Show Response
Show Response
{
"wiki": { # optional
"wiki_id": Optional[str],
"workspace_id": Optional[str],
"created_by_id": Optional[str],
"display_name": Optional[str],
"repository_key": Optional[str],
"repository": { # optional
"provider": Optional[str],
"owner": Optional[str],
"name": Optional[str],
"url": Optional[str],
"default_branch": Optional[str],
},
"branch": Optional[str],
"scm_connection_id": Optional[str],
"settings": { # optional
"model": Optional[str],
"computer_template": Optional[str],
"depth": Optional[str],
"refresh_cadence": Optional[str],
"publish_to_repository": Optional[bool],
},
"loop_id": Optional[str],
"status": Optional[str],
"current_run_id": Optional[str],
"last_generated_commit": Optional[str],
"last_generated_at": str, # optional
"page_count": Optional[int],
"created_at": str, # optional
"updated_at": str, # optional
"factory_id": Optional[str],
},
}
{
wiki?: {
wikiId?: string;
workspaceId?: string;
createdById?: string;
displayName?: string;
repositoryKey?: string;
repository?: {
provider?: string;
owner?: string;
name?: string;
url?: string;
defaultBranch?: string;
};
branch?: string;
scmConnectionId?: string;
settings?: {
model?: string;
computerTemplate?: string;
depth?: string;
refreshCadence?: string;
publishToRepository?: boolean;
};
loopId?: string;
status?: string;
currentRunId?: string;
lastGeneratedCommit?: string;
lastGeneratedAt?: Date;
pageCount?: number;
createdAt?: Date;
updatedAt?: Date;
factoryId?: string;
};
}
Inspect Repository
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.inspect_repository(scm_connection_id="<id>", repository_url="https://github.com/orq-ai/orq-cookbooks", branch="main")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.inspectRepository({
scmConnectionId: "<id>",
repositoryUrl: "https://github.com/orq-ai/orq-cookbooks",
branch: "main",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"scm_connection_id": Optional[str],
"repository_url": Optional[str],
"branch": Optional[str],
}
{
scmConnectionId?: string;
repositoryUrl?: string;
branch?: string;
}
Show Response
Show Response
{
"available": Optional[bool],
"page_count": Optional[int],
}
{
available?: boolean;
pageCount?: number;
}
Retrieve a Wiki
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.get(wiki_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.get({
wikiId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
}
{
wikiId: string; // required
}
Show Response
Show Response
{
"wiki": { # optional
"wiki_id": Optional[str],
"workspace_id": Optional[str],
"created_by_id": Optional[str],
"display_name": Optional[str],
"repository_key": Optional[str],
"repository": { # optional
"provider": Optional[str],
"owner": Optional[str],
"name": Optional[str],
"url": Optional[str],
"default_branch": Optional[str],
},
"branch": Optional[str],
"scm_connection_id": Optional[str],
"settings": { # optional
"model": Optional[str],
"computer_template": Optional[str],
"depth": Optional[str],
"refresh_cadence": Optional[str],
"publish_to_repository": Optional[bool],
},
"loop_id": Optional[str],
"status": Optional[str],
"current_run_id": Optional[str],
"last_generated_commit": Optional[str],
"last_generated_at": str, # optional
"page_count": Optional[int],
"created_at": str, # optional
"updated_at": str, # optional
"factory_id": Optional[str],
},
}
{
wiki?: {
wikiId?: string;
workspaceId?: string;
createdById?: string;
displayName?: string;
repositoryKey?: string;
repository?: {
provider?: string;
owner?: string;
name?: string;
url?: string;
defaultBranch?: string;
};
branch?: string;
scmConnectionId?: string;
settings?: {
model?: string;
computerTemplate?: string;
depth?: string;
refreshCadence?: string;
publishToRepository?: boolean;
};
loopId?: string;
status?: string;
currentRunId?: string;
lastGeneratedCommit?: string;
lastGeneratedAt?: Date;
pageCount?: number;
createdAt?: Date;
updatedAt?: Date;
factoryId?: string;
};
}
Delete a Wiki
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.delete(wiki_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.delete({
wikiId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
}
{
wikiId: string; // required
}
Update a Wiki
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.update(wiki_id="<id>", display_name="Product handbook")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.update({
wikiId: "<id>",
updateWikiRequest: {
displayName: "Product handbook",
},
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
"display_name": Optional[str],
"scm_connection_id": Optional[str],
"settings": { # optional
"model": Optional[str],
"computer_template": Optional[str],
"depth": Optional[str],
"refresh_cadence": Optional[str],
"publish_to_repository": Optional[bool],
},
}
{
wikiId: string; // required
updateWikiRequest: { // required
displayName?: string;
scmConnectionId?: string;
settings?: {
model?: string;
computerTemplate?: string;
depth?: string;
refreshCadence?: string;
publishToRepository?: boolean;
};
};
}
Show Response
Show Response
{
"wiki": { # optional
"wiki_id": Optional[str],
"workspace_id": Optional[str],
"created_by_id": Optional[str],
"display_name": Optional[str],
"repository_key": Optional[str],
"repository": { # optional
"provider": Optional[str],
"owner": Optional[str],
"name": Optional[str],
"url": Optional[str],
"default_branch": Optional[str],
},
"branch": Optional[str],
"scm_connection_id": Optional[str],
"settings": { # optional
"model": Optional[str],
"computer_template": Optional[str],
"depth": Optional[str],
"refresh_cadence": Optional[str],
"publish_to_repository": Optional[bool],
},
"loop_id": Optional[str],
"status": Optional[str],
"current_run_id": Optional[str],
"last_generated_commit": Optional[str],
"last_generated_at": str, # optional
"page_count": Optional[int],
"created_at": str, # optional
"updated_at": str, # optional
"factory_id": Optional[str],
},
}
{
wiki?: {
wikiId?: string;
workspaceId?: string;
createdById?: string;
displayName?: string;
repositoryKey?: string;
repository?: {
provider?: string;
owner?: string;
name?: string;
url?: string;
defaultBranch?: string;
};
branch?: string;
scmConnectionId?: string;
settings?: {
model?: string;
computerTemplate?: string;
depth?: string;
refreshCadence?: string;
publishToRepository?: boolean;
};
loopId?: string;
status?: string;
currentRunId?: string;
lastGeneratedCommit?: string;
lastGeneratedAt?: Date;
pageCount?: number;
createdAt?: Date;
updatedAt?: Date;
factoryId?: string;
};
}
Get Page
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.get_page(wiki_id="<id>", path="docs/index.md")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.getPage({
wikiId: "<id>",
path: "docs/index.md",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
"path": Optional[str],
"run_id": Optional[str],
}
{
wikiId: string; // required
path?: string;
runId?: string;
}
Show Response
Show Response
{
"page": { # optional
"path": Optional[str],
"title": Optional[str],
"section": Optional[str],
"order": Optional[int],
"content_hash": Optional[str],
"edited_by_id": Optional[str],
"markdown": Optional[str],
"run_id": Optional[str],
"links": List[str], # optional
"edited_at": str, # optional
},
}
{
page?: {
path?: string;
title?: string;
section?: string;
order?: number;
contentHash?: string;
editedById?: string;
markdown?: string;
runId?: string;
links?: string[];
editedAt?: Date;
};
}
Update Page
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.update_page(wiki_id="<id>", path="docs/index.md", markdown="# Overview", expected_content_hash="<hash>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.updatePage({
wikiId: "<id>",
updateWikiPageRequest: {
path: "docs/index.md",
markdown: "# Overview",
expectedContentHash: "<hash>",
},
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
"path": Optional[str],
"markdown": Optional[str],
"expected_content_hash": Optional[str],
}
{
wikiId: string; // required
updateWikiPageRequest: { // required
path?: string;
markdown?: string;
expectedContentHash?: string;
};
}
Show Response
Show Response
{
"page": { # optional
"path": Optional[str],
"title": Optional[str],
"section": Optional[str],
"order": Optional[int],
"content_hash": Optional[str],
"edited_by_id": Optional[str],
"markdown": Optional[str],
"run_id": Optional[str],
"links": List[str], # optional
"edited_at": str, # optional
},
}
{
page?: {
path?: string;
title?: string;
section?: string;
order?: number;
contentHash?: string;
editedById?: string;
markdown?: string;
runId?: string;
links?: string[];
editedAt?: Date;
};
}
Refresh a Wiki
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.refresh(wiki_id="<id>", full=False)
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.refresh({
wikiId: "<id>",
refreshWikiRequest: {
full: false,
},
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
"full": Optional[bool],
}
{
wikiId: string; // required
refreshWikiRequest: { // required
full?: boolean;
};
}
Show Response
Show Response
{
"run": { # optional
"run_id": Optional[str],
"workspace_id": Optional[str],
"wiki_id": Optional[str],
"agent_session_id": Optional[str],
"agent_session_run_id": Optional[str],
"kind": Optional[str],
"trigger": Optional[str],
"pull_request_url": Optional[str],
"base_commit": Optional[str],
"head_commit": Optional[str],
"status": Optional[str],
"error": Optional[str],
"stats": { # optional
"page_count": Optional[int],
"section_count": Optional[int],
"mermaid_count": Optional[int],
"bytes_": Optional[str],
},
"started": str, # optional
"finished": str, # optional
},
}
{
run?: {
runId?: string;
workspaceId?: string;
wikiId?: string;
agentSessionId?: string;
agentSessionRunId?: string;
kind?: string;
trigger?: string;
pullRequestUrl?: string;
baseCommit?: string;
headCommit?: string;
status?: string;
error?: string;
stats?: {
pageCount?: number;
sectionCount?: number;
mermaidCount?: number;
bytes?: string;
};
started?: Date;
finished?: Date;
};
}
List Runs
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.list_runs(wiki_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.listRuns({
wikiId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
"limit": Optional[int],
}
{
wikiId: string; // required
limit?: number;
}
Show Response
Show Response
{
"data": [{ # optional
"run_id": Optional[str],
"workspace_id": Optional[str],
"wiki_id": Optional[str],
"agent_session_id": Optional[str],
"agent_session_run_id": Optional[str],
"kind": Optional[str],
"trigger": Optional[str],
"pull_request_url": Optional[str],
"base_commit": Optional[str],
"head_commit": Optional[str],
"status": Optional[str],
"error": Optional[str],
"stats": { # optional
"page_count": Optional[int],
"section_count": Optional[int],
"mermaid_count": Optional[int],
"bytes_": Optional[str],
},
"started": str, # optional
"finished": str, # optional
}],
}
{
data?: {
runId?: string;
workspaceId?: string;
wikiId?: string;
agentSessionId?: string;
agentSessionRunId?: string;
kind?: string;
trigger?: string;
pullRequestUrl?: string;
baseCommit?: string;
headCommit?: string;
status?: string;
error?: string;
stats?: {
pageCount?: number;
sectionCount?: number;
mermaidCount?: number;
bytes?: string;
};
started?: Date;
finished?: Date;
}[];
}
Search Wikis
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.search(wiki_id="<id>", query="reset my password")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.search({
wikiId: "<id>",
query: "reset my password",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
"query": Optional[str],
"limit": Optional[int],
}
{
wikiId: string; // required
query?: string;
limit?: number;
}
Show Response
Show Response
{
"hits": [{ # optional
"path": Optional[str],
"page_title": Optional[str],
"heading_path": Optional[str],
"anchor": Optional[str],
"snippet": Optional[str],
}],
}
{
hits?: {
path?: string;
pageTitle?: string;
headingPath?: string;
anchor?: string;
snippet?: string;
}[];
}
Get Tree
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.wikis.get_tree(wiki_id="<id>")
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.wikis.getTree({
wikiId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"wiki_id": str, # required
}
{
wikiId: string; // required
}
Show Response
Show Response
{
"pages": [{ # optional
"path": Optional[str],
"title": Optional[str],
"section": Optional[str],
"order": Optional[int],
"content_hash": Optional[str],
"edited_by_id": Optional[str],
}],
}
{
pages?: {
path?: string;
title?: string;
section?: string;
order?: number;
contentHash?: string;
editedById?: string;
}[];
}