Skip to content

Commit

Permalink
fix: firefall interface missing functions (#533)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominique Jäggi <[email protected]>
  • Loading branch information
dzehnder and solaris007 authored Jan 14, 2025
1 parent 7ad64cc commit d62db11
Showing 1 changed file with 93 additions and 0 deletions.
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>;
}

0 comments on commit d62db11

Please sign in to comment.