Results:
➤ uv run with_httpx.py
time taken to make 10000 requests: 20.2337 seconds
Counter({200: 10000})
➤ uv run with_thread_pool.py
from typing_extensions import TypedDict | |
import logfire | |
from httpx import AsyncClient | |
from agents import RunContextWrapper, Agent, function_tool, Runner | |
from agents.tool import WebSearchTool | |
logfire.configure() | |
logfire.instrument_openai_agents() |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Am I active</title> | |
</head> | |
<body> | |
<input name="testing"/> | |
<div class="context" style="margin-bottom: 100px"> |
PointPydanticBaseModel v2.10.4: 538ns | |
PointPydanticTypedDict v2.10.4: 247ns | |
attrs v24.3.0: 551ns |
import json | |
from dataclasses import dataclass | |
from typing import Annotated, Any, Callable, Union | |
import pydantic_core | |
import pytest | |
from inline_snapshot import snapshot | |
from pydantic import BaseModel, Field | |
from pydantic_core import PydanticSerializationError |
[ | |
{ | |
"id": 0, | |
"parent": null, | |
"path": "roadmap.md", | |
"level": 1, | |
"title": "Roadmap", | |
"content": "Here is the roadmap for **Pydantic Logfire**. This is a living document, and it will be updated as we progress.\n\nIf you have any questions, or a feature request, **please join our [Slack][slack]**." | |
}, | |
{ |
""" | |
To run install: | |
logfire[fastapi] | |
fastapi | |
uvicorn | |
""" | |
import time | |
import logfire | |
import uvicorn | |
from fastapi import FastAPI |
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import sys | |
from pathlib import Path | |
import tinify | |
# TODO find a way to check if files have already been tinified before processing | |
tinify.key = os.getenv('TINIFY_KEY') | |
if not tinify.key: |
from __future__ import annotations | |
import asyncio | |
import csv | |
import sys | |
from dataclasses import dataclass, asdict, fields | |
from pathlib import Path | |
from typing import Literal | |
import toml | |
from httpx import AsyncClient |
<h1>Web worker demo</h1> | |
<h3>Write Code:</h3> | |
<textarea id="code" rows="10" cols="80">return "hello world";</textarea> | |
<button id="run">Run</button> | |
<h3>Output:</h3> | |
<pre id="output"></pre> | |