Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix header images #55

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/.partials/index-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="text-center">
<img class="index-header" src="./img/pydantic-ai-dark.svg#only-dark" alt="PydanticAI">
</div>
<div class="text-center">
<img class="index-header" src="./img/pydantic-ai-light.svg#only-light" alt="PydanticAI">
</div>
<p class="text-center">
<em>Agent Framework / shim to use Pydantic with LLMs</em>
</p>
<p class="text-center">
<a href="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml?query=branch%3Amain">
<img src="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml/badge.svg?event=push" alt="CI">
</a>
<a href="https://pypi.python.org/pypi/pydantic-ai">
<img src="https://img.shields.io/pypi/v/pydantic-ai.svg" alt="PyPI">
</a>
<a href="https://github.com/pydantic/pydantic-ai">
<img src="https://img.shields.io/pypi/pyversions/pydantic-ai.svg" alt="versions">
</a>
<a href="https://github.com/pydantic/pydantic-ai/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/pydantic/pydantic-ai.svg" alt="license">
</a>
</p>
8 changes: 4 additions & 4 deletions docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ print(result.data)

There are three ways to run an agent:

1. [`#!python agent.run()`][pydantic_ai.Agent.run] — a coroutine which returns a result containing a completed response, returns a [`RunResult`][pydantic_ai.result.RunResult]
2. [`#!python agent.run_sync()`][pydantic_ai.Agent.run_sync] — a plain function which returns a result containing a completed response (internally, this just calls `#!python asyncio.run(self.run())`), returns a [`RunResult`][pydantic_ai.result.RunResult]
3. [`#!python agent.run_stream()`][pydantic_ai.Agent.run_stream] — a coroutine which returns a result containing methods to stream a response as an async iterable, returns a [`StreamedRunResult`][pydantic_ai.result.StreamedRunResult]
1. [`agent.run()`][pydantic_ai.Agent.run] — a coroutine which returns a result containing a completed response, returns a [`RunResult`][pydantic_ai.result.RunResult]
2. [`agent.run_sync()`][pydantic_ai.Agent.run_sync] — a plain function which returns a result containing a completed response (internally, this just calls `asyncio.run(self.run())`), returns a [`RunResult`][pydantic_ai.result.RunResult]
3. [`agent.run_stream()`][pydantic_ai.Agent.run_stream] — a coroutine which returns a result containing methods to stream a response as an async iterable, returns a [`StreamedRunResult`][pydantic_ai.result.StreamedRunResult]

Here's a simple example demonstrating all three:

Expand All @@ -85,7 +85,7 @@ async def main():
print(await response.get_data())
#> London
```
_(This example is complete, it can be run "as is")_
_(This example is complete, it can be runc "as is")_

You can also pass messages from previous runs to continue a conversation or provide context, as described in [Messages and Chat History](message-history.md).

Expand Down
9 changes: 9 additions & 0 deletions docs/extra/tweaks.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
.hide {
display: none;
}

.text-center {
text-align: center;
}

img.index-header {
width: 70%;
max-width: 500px;
}
24 changes: 1 addition & 23 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
<p align="center">
<img src="./img/pydantic-ai-dark.svg#only-dark" alt="PydanticAI" style="max-width: 600px">
</p>
<p align="center">
<img src="./img/pydantic-ai-light.svg#only-light" alt="PydanticAI" style="max-width: 600px">
</p>
<p align="center">
<em>Agent Framework / shim to use Pydantic with LLMs</em>
</p>
<p align="center">
<a href="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml?query=branch%3Amain">
<img src="https://github.com/pydantic/pydantic-ai/actions/workflows/ci.yml/badge.svg?event=push" alt="CI">
</a>
<a href="https://pypi.python.org/pypi/pydantic-ai">
<img src="https://img.shields.io/pypi/v/pydantic-ai.svg" alt="PyPI">
</a>
<a href="https://github.com/pydantic/pydantic-ai">
<img src="https://img.shields.io/pypi/pyversions/pydantic-ai.svg" alt="versions">
</a>
<a href="https://github.com/pydantic/pydantic-ai/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/pydantic/pydantic-ai.svg" alt="license">
</a>
</p>
--8<-- "docs/.partials/index-header.html"

# PydanticAI {.hide}

Expand Down
Loading