@agentdao/core
Version:
Core functionality, skills, and ready-made UI components for AgentDAO - Web3 subscriptions, content generation, social media, help support, live chat, RSS fetching, web search, and agent pricing integration
156 lines (155 loc) • 3.61 kB
TypeScript
export interface PhotoSkillConfig {
agentId: string;
agentName: string;
domain: string;
providers: {
unsplash?: {
enabled: boolean;
apiKey?: string;
accessKey?: string;
};
pexels?: {
enabled: boolean;
apiKey?: string;
};
pixabay?: {
enabled: boolean;
apiKey?: string;
};
};
search: {
defaultProvider?: 'unsplash' | 'pexels' | 'pixabay' | 'all';
maxResults?: number;
defaultSize?: 'small' | 'medium' | 'large' | 'original';
includeOrientation?: boolean;
};
integration?: {
webhooks?: {
enabled: boolean;
url: string;
};
};
analytics?: {
enabled: boolean;
tracking: string[];
};
database?: {
endpoint: string;
apiKey?: string;
};
}
export interface PhotoSearchRequest {
query: string;
provider?: 'unsplash' | 'pexels' | 'pixabay' | 'all';
size?: 'small' | 'medium' | 'large' | 'original';
orientation?: 'landscape' | 'portrait' | 'square';
color?: string;
category?: string;
maxResults?: number;
page?: number;
}
export interface StockPhoto {
id: string;
url: string;
thumbnailUrl: string;
previewUrl: string;
downloadUrl: string;
title: string;
description?: string;
photographer: {
name: string;
username: string;
profileUrl: string;
};
dimensions: {
width: number;
height: number;
};
size: number;
format: string;
tags: string[];
category: string;
license: string;
provider: string;
createdAt: Date;
metadata: {
likes?: number;
downloads?: number;
views?: number;
color?: string;
location?: string;
};
}
export interface PhotoCollection {
id: string;
title: string;
description?: string;
coverPhoto: StockPhoto;
photoCount: number;
provider: string;
createdAt: Date;
}
export declare class PhotoSkill {
private config;
constructor(config: PhotoSkillConfig);
/**
* Search for stock photos
*/
searchPhotos(request: PhotoSearchRequest): Promise<StockPhoto[]>;
/**
* Get trending photos
*/
getTrendingPhotos(options?: {
provider?: 'unsplash' | 'pexels' | 'pixabay';
category?: string;
maxResults?: number;
}): Promise<StockPhoto[]>;
/**
* Get photo collections
*/
getCollections(options?: {
provider?: 'unsplash' | 'pexels' | 'pixabay';
maxResults?: number;
}): Promise<PhotoCollection[]>;
/**
* Get photo by ID
*/
getPhotoById(photoId: string, provider?: 'unsplash' | 'pexels' | 'pixabay'): Promise<StockPhoto>;
/**
* Download photo
*/
downloadPhoto(photoId: string, provider?: 'unsplash' | 'pexels' | 'pixabay'): Promise<{
url: string;
filename: string;
size: number;
}>;
/**
* Get photo categories
*/
getCategories(): Promise<Array<{
id: string;
name: string;
description: string;
photoCount: number;
}>>;
/**
* Search Unsplash photos
*/
private searchUnsplash;
/**
* Search Pexels photos
*/
private searchPexels;
/**
* Search Pixabay photos
*/
private searchPixabay;
/**
* Get a sample photo for testing
*/
private getSamplePhoto;
/**
* Track search analytics
*/
private trackSearch;
}