Skip to content

Latest commit

 

History

History
188 lines (133 loc) · 5.04 KB

File metadata and controls

188 lines (133 loc) · 5.04 KB

Agent

Method HTTP request
all_sessions GET /v2/aipAgents/agents/allSessions
all_sessions_page GET /v2/aipAgents/agents/allSessions
get GET /v2/aipAgents/agents/{agentRid}

all_sessions

List all conversation sessions between the calling user and all accessible Agents that were created by this client. Sessions are returned in order of most recently updated first.

Parameters

Name Type Description Notes
page_size Optional[PageSize] pageSize [optional]
page_token Optional[PageToken] pageToken [optional]
preview Optional[PreviewMode] preview [optional]

Return type

ResourceIterator[Session]

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[PreviewMode] | preview
preview = None


try:
    for agent in foundry_client.aip_agents.Agent.all_sessions(
        page_size=page_size,
        page_token=page_token,
        preview=preview,
    ):
        pprint(agent)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Agent.all_sessions: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 AgentsSessionsPage application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

all_sessions_page

List all conversation sessions between the calling user and all accessible Agents that were created by this client. Sessions are returned in order of most recently updated first.

Parameters

Name Type Description Notes
page_size Optional[PageSize] pageSize [optional]
page_token Optional[PageToken] pageToken [optional]
preview Optional[PreviewMode] preview [optional]

Return type

AgentsSessionsPage

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[PreviewMode] | preview
preview = None


try:
    api_response = foundry_client.aip_agents.Agent.all_sessions_page(
        page_size=page_size,
        page_token=page_token,
        preview=preview,
    )
    print("The all_sessions_page response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Agent.all_sessions_page: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 AgentsSessionsPage application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

Get details for an AIP Agent.

Parameters

Name Type Description Notes
agent_rid AgentRid agentRid
preview Optional[PreviewMode] preview [optional]
version Optional[AgentVersionString] version [optional]

Return type

Agent

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# AgentRid | agentRid
agent_rid = "ri.aip-agents..agent.732cd5b4-7ca7-4219-aabb-6e976faf63b1"
# Optional[PreviewMode] | preview
preview = None
# Optional[AgentVersionString] | version
version = None


try:
    api_response = foundry_client.aip_agents.Agent.get(
        agent_rid,
        preview=preview,
        version=version,
    )
    print("The get response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling Agent.get: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 Agent application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]