Skip to content

Commit

Permalink
updated hosted-api docs (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
adnaans authored Nov 27, 2023
1 parent a962141 commit 6b6ff5a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 34 deletions.
4 changes: 2 additions & 2 deletions docs/do-not-call-detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ The `run_do_not_call_detection` parameter on outbound call creation defines whet
or not to run rudimentary Do Not Call analysis.

```python
from vocode import CreateCallAgentParams
from vocode import CreateCallAgentParams, PromptParams

vocode_client.calls.create_call(
from_number="<YOUR VOCODE NUMBER>",
to_number="15555555555",
agent=CreateCallAgentParams(
prompt=Prompt(
prompt=PromptParams(
content="Ask Eliot if the sun is on today"
),
),
Expand Down
8 changes: 5 additions & 3 deletions docs/injecting-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ In order to have your bot use injected variables, the prompt must include templa
our prompt to accept a user's first name and link it to our context endpoint.

```python
from vocode import AgentUpdateParams
from vocode import AgentUpdateParams, PromptUpdateParams

name_prompt = "You are talking to ${name}"
number = vocode_client.numbers.update_number(
phone_number="YOUR_NUMBER",
inbound_agent=AgentUpdateParams(prompt=name_prompt),
context_endpoint="YOUR_CONTEXT_URL"
inbound_agent=AgentUpdateParams(
prompt=PromptUpdateParams(content=name_prompt),
context_endpoint="YOUR_CONTEXT_URL",
),
)
```

Expand Down
6 changes: 3 additions & 3 deletions docs/machine-detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ phone call is an answerphone as well as subscribe to events relating to machine
The `on_no_human_answer` parameter defines what should happen if a machine answers the phone.

```python
from vocode import CreateCallAgentParams
from vocode import CreateCallAgentParams, PromptParams

vocode_client.calls.create_call(
from_number="<YOUR VOCODE NUMBER>",
to_number="15555555555",
agent=CreateCallAgentParams(
prompt=Prompt(
prompt=PromptParams(
content="Ask Ajay if his refrigerator is running"
),
),
on_no_human_answer="hangup"
on_no_human_answer="hangup",
)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/retrieve-call-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ If you enabled call recording, you can download the call recording file.

<CodeGroup>
```python Python
vocode_client.calls.recording(id="CALL_ID")
vocode_client.calls.get_recording(id="CALL_ID")
```

```javascript TypeScript
const calls = await vocode.calls.listCalls();
const recording = await vocode.calls.recording({ id: calls[0].id });
const recording = await vocode.calls.get_recording({ id: calls[0].id });
```

```curl cURL
Expand Down
2 changes: 1 addition & 1 deletion docs/setting-up-webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ The full list of `EventType` is listed here:
- `EVENT_PHONE_CALL_ENDED`: Indicating the phone call has ended.
- `EVENT_TRANSCRIPT`: The transcription of the entire conversation.
- `EVENT_RECORDING`: The recording of the conversation has become available.
- `EVENT_MACHINE_DETECTION`: Indicating whether a human or a machine has picked up the phone.
- `EVENT_HUMAN_DETECTION`: Indicating whether a human or a machine has picked up the phone.
38 changes: 21 additions & 17 deletions docs/using-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Agents on phone calls can take three actions:

```python Python
vocode_client.actions.create_action(
request=CreateActionRequest(
type="action_end_conversation",
)
request={
"type": "action_end_conversation",
}
)
```

Expand Down Expand Up @@ -41,9 +41,9 @@ curl --request POST \

```python Python
vocode_client.actions.create_action(
request=CreateActionRequest(
type="action_dtmf",
)
request={
"type":"action_dtmf",
}
)
```

Expand Down Expand Up @@ -71,12 +71,12 @@ curl --request POST \

```python Python
vocode_client.actions.create_action(
request=CreateActionRequest(
type="action_transfer_call",
config=TransferCallActionUpdateParamsConfig(
phone_number="11234567890"
)
)
request={
"type":"action_transfer_call",
"config":{
"phone_number":"11234567890"
}
}
)
```

Expand Down Expand Up @@ -109,9 +109,11 @@ You can attach these as IDs to your phone number agent as follows:
<CodeGroup>

```python Python
from vocode import AgentUpdateParams

vocode_client.numbers.update_number(
phone_number="11234567890",
inbound_agent=UpdateNumberRequestInboundAgent(
inbound_agent=AgentUpdateParams(
actions=["<ACTION UUID>"]
)
)
Expand Down Expand Up @@ -145,14 +147,16 @@ You can also add these as actions as raw payloads as follows:
<CodeGroup>

```python Python
from vocode import AgentUpdateParams, TransferCallActionUpdateParams

vocode_client.numbers.update_number(
phone_number="11234567890",
inbound_agent=UpdateNumberRequestInboundAgent(
inbound_agent=AgentUpdateParams(
actions=[TransferCallActionUpdateParams(
type="action_transfer_call",
config=TransferCallActionUpdateParamsConfig(
phone_number="11234567890"
)
config={
"phone_number":"11234567890"
}
)]
)
)
Expand Down
14 changes: 8 additions & 6 deletions docs/vectordb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ To add your vector database to your agent, you need to add a vector database con
<CodeGroup>

```python update_agent.py
from vocode import PineconeVectorDatabaseUpdateParams
from vocode import AgentUpdateParams, PineconeVectorDatabaseUpdateParams

agent = vocode_client.agents.update_agent(
id="AGENT_ID",
request=PineconeVectorDatabaseUpdateParams(
type="vector_database_pinecone",
index="PINECONE_INDEX",
api_key="PINECONE_API_KEY",
api_environment="PINECONE_API_ENVIRONMENT",
request=AgentUpdateParams(
vector_database=PineconeVectorDatabaseUpdateParams(
type="vector_database_pinecone",
index="PINECONE_INDEX",
api_key="PINECONE_API_KEY",
api_environment="PINECONE_API_ENVIRONMENT",
)
),
)
```
Expand Down

0 comments on commit 6b6ff5a

Please sign in to comment.