Skip to content

Instantly share code, notes, and snippets.

Introducing Dify Agent (Experimental): A New Agent Experience in Dify

Warning

You should provide Dify Agent services ⚠️only to trusted, non-malicious users⚠️.

As many of you know, the shell-based LLM agent paradigm has brought a major leap in agent capabilities and changed how we think about agents. Meanwhile, Skills provide a standardized way to package and distribute capabilities, making it easier to build powerful agents.

Today, we are experimentally launching Dify Agent. Like other leading agents, it runs in a Linux sandbox. This release includes:

  • A builder for creating Dify Agents
# This is the workround before https://github.com/pydantic/pydantic-ai/issues/224 is fixed
from pydantic_ai.models.openai import (
OpenAIModel,
OpenAIModelSettings,
ModelRequestParameters,
)
from itertools import chain
from openai import NOT_GIVEN, AsyncOpenAI, AsyncStream
from openai.types import ChatModel, chat
import asyncio
from typing import (
Any,
Awaitable,
Generator,
Generic,
Tuple,
TypeVar,
Union,
)
@BeautyyuYanli
BeautyyuYanli / http_once.py
Created December 1, 2023 16:38
Listen for http request only once, to complete OAuth2.0 locally.
import socket
from typing import Optional
def http_once(
host: str,
port: int,
buffer_size: int = 4096,
timeout: Optional[float] = None,
response: str = "OK",
include tencent-qq.local
# Persistent global definitions
include globals.local
noblacklist ${HOME}/.config/QQ
# Allow opening hyperlinks
include allow-bin-sh.inc
include disable-common.inc