Skip to content

Commit 6e8bc46

Browse files
chore(internal): codegen related update (#74)
1 parent e07435e commit 6e8bc46

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,42 @@ for agent in first_page.agents:
138138
# Remove `await` for non-async usage.
139139
```
140140

141+
## Nested params
142+
143+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
144+
145+
```python
146+
from contextual import ContextualAI
147+
148+
client = ContextualAI()
149+
150+
create_agent_output = client.agents.create(
151+
name="xxx",
152+
agent_configs={
153+
"filter_and_rerank_config": {"top_k_reranked_chunks": 0},
154+
"generate_response_config": {
155+
"calculate_groundedness": True,
156+
"frequency_penalty": 0,
157+
"max_new_tokens": 0,
158+
"seed": 0,
159+
"temperature": 0,
160+
"top_p": 0,
161+
},
162+
"global_config": {
163+
"enable_filter": True,
164+
"enable_multi_turn": True,
165+
"enable_rerank": True,
166+
},
167+
"retrieval_config": {
168+
"lexical_alpha": 0,
169+
"semantic_alpha": 0,
170+
"top_k_retrieved_chunks": 0,
171+
},
172+
},
173+
)
174+
print(create_agent_output.agent_configs)
175+
```
176+
141177
## File uploads
142178

143179
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.

scripts/test

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ else
5252
echo
5353
fi
5454

55+
export DEFER_PYDANTIC_BUILD=false
56+
5557
echo "==> Running tests"
5658
rye run pytest "$@"
5759

0 commit comments

Comments
 (0)