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: firefall interface missing functions #533

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Changes from all commits
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
93 changes: 93 additions & 0 deletions packages/spacecat-shared-gpt-client/src/clients/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,99 @@ export class FirefallClient {
* Sends the given prompt to the Firefall GPT API and returns the response.
* @param {string} prompt The prompt to send to the Firefall GPT API.
* @returns {Promise<string>} The response from the Firefall GPT API.
* @deprecated since version 1.2.19. Use fetchCapabilityExecution instead.
*/
fetch(prompt: string): Promise<string>;

/**
* Fetches data from Firefall Chat Completion API.
*
* @param {string} prompt - The text prompt to provide to Firefall
* @param {object} [options] - The options for the call, with optional properties:
* - imageUrls: An array of URLs of the images to provide to Firefall
* - model: LLM Model to use (default: gpt-4-turbo).
* Use 'gpt-4-vision' with images.
* JSON mode is only currently supported with the following models: gpt-35-turbo-1106, gpt-4-turbo
* @returns {Promise<object>} A promise that resolves to an object containing the chat completion.
*
* The returned object has the following structure:
*
* @example
* {
* "conversation_identifier": string | null,
* "query_id": string | null,
* "model": string,
* "choices": [
* {
* "finish_reason": string,
* "index": number,
* "message": {
* "role": string,
* "content": string,
* "function_call": object | null
* },
* "content_filter_results": {
* "hate": {
* "filtered": boolean,
* "severity": string
* },
* "self_harm": {
* "filtered": boolean,
* "severity": string
* },
* "sexual": {
* "filtered": boolean,
* "severity": string
* },
* "violence": {
* "filtered": boolean,
* "severity": string
* }
* },
* "logprobs": object | null
* }
* ],
* "created_at": string,
* "usage": {
* "completion_tokens": number,
* "prompt_tokens": number,
* "total_tokens": number
* },
* "prompt_filter_results": [
* {
* "prompt_index": number,
* "content_filter_results": {
* "hate": {
* "filtered": boolean,
* "severity": string
* },
* "jailbreak": {
* "filtered": boolean,
* "detected": boolean
* },
* "self_harm": {
* "filtered": boolean,
* "severity": string
* },
* "sexual": {
* "filtered": boolean,
* "severity": string
* },
* "violence": {
* "filtered": boolean,
* "severity": string
* }
* }
* }
* ]
* }
*/
fetchChatCompletion(prompt: string, options?: object): Promise<object>;

/**
* Fetches data from Firefall API.
* @param prompt The text prompt to provide to Firefall
* @returns {Promise<string>} - AI response
*/
fetchCapabilityExecution(prompt: string): Promise<string>;
}
Loading