MCPcopy Create free account
hub / github.com/agentset-ai/agentset / pythonExample

Function pythonExample

apps/web/src/lib/code-examples/ingest.ts:48–72  ·  view source on GitHub ↗
(apiKey?: string)

Source from the content-addressed store, hash-verified

46});
47console.log(result);
48`;
49
50export const pythonExample = (apiKey?: string) => /* python */ `
51from agentset import Agentset
52
53client = Agentset(
54 namespace_id="{{namespace}}",
55 token="${apiKey ?? "YOUR_API_KEY"}",${pythonSdkApiUrlOption}
56)
57
58job = client.ingest_jobs.create(
59 payload={
60 "type": "FILE",
61 "fileUrl": "https://example.com/file.pdf",
62 "fileName": "document.pdf",
63 },
64 config={
65 "chunkSize": 2048,
66 "mode": "balanced",
67 "metadata": {
68 "foo": "bar",
69 },
70 }
71)
72
73print(f"Upload started: {job.data.id}")
74`;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected