Skip to content

Commit a4e91e1

Browse files
authored
docs: add docs on openai's reasoning models (#1843)
Closes #1688
1 parent fc27554 commit a4e91e1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/griptape-framework/drivers/prompt-drivers.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ This driver uses [OpenAi function calling](https://platform.openai.com/docs/guid
100100

101101
`response_format` and `seed` are unique to the OpenAI Chat Prompt Driver and Azure OpenAi Chat Prompt Driver.
102102

103+
OpenAi's [reasoning models](https://platform.openai.com/docs/guides/reasoning?api-mode=chat) can also be used, and come with an additional parameter: [reasoning_effort](../../reference/griptape/drivers/prompt/openai_chat_prompt_driver.md#griptape.drivers.prompt.openai_chat_prompt_driver.OpenAiChatPromptDriver.reasoning_effort).
104+
105+
```python
106+
--8<-- "docs/griptape-framework/drivers/src/prompt_drivers_openai_reasoning.py"
107+
```
108+
103109
### OpenAI Compatible
104110

105111
Many services such as [LMStudio](https://lmstudio.ai/) and [OhMyGPT](https://www.ohmygpt.com/) provide OpenAI-compatible APIs. You can use the [OpenAiChatPromptDriver](../../reference/griptape/drivers/prompt/openai_chat_prompt_driver.md) to interact with these services.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
3+
from griptape.drivers.prompt.openai import OpenAiChatPromptDriver
4+
from griptape.structures import Agent
5+
6+
agent = Agent(
7+
prompt_driver=OpenAiChatPromptDriver(
8+
api_key=os.environ["OPENAI_API_KEY"],
9+
model="o3-mini",
10+
reasoning_effort="medium",
11+
),
12+
)
13+
14+
agent.run("""Write a bash script that takes a matrix represented as a string with
15+
format '[1,2],[3,4],[5,6]' and prints the transpose in the same format.""")

0 commit comments

Comments
 (0)