> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/openai.md).

# openai

[OpenAI](https://www.openai.com/) is a leading AI research and deployment company that offers a suite of powerful AI models and APIs. OpenAI provides cutting-edge technologies including large language models (like GPT-4), image generation (DALL-E), and embeddings that enable developers to build sophisticated AI-powered applications.

With OpenAI, you can:

* **Generate text**: Create human-like text for various applications using GPT models
* **Create images**: Transform text descriptions into visual content with DALL-E
* **Produce embeddings**: Convert text into numerical vectors for semantic search and analysis
* **Build AI assistants**: Develop conversational agents with specialized knowledge
* **Process and analyze data**: Extract insights and patterns from unstructured text
* **Translate languages**: Convert content between different languages with high accuracy
* **Summarize content**: Condense long-form text while preserving key information

In Agent Forge, the OpenAI integration enables your agents to leverage these powerful AI capabilities programmatically as part of their workflows. This allows for sophisticated automation scenarios that combine natural language understanding, content generation, and semantic analysis. Your agents can generate vector embeddings from text, which are numerical representations that capture semantic meaning, enabling advanced search, classification, and recommendation systems. Additionally, through the DALL-E integration, agents can create images from text descriptions, opening up possibilities for visual content generation. This integration bridges the gap between your workflow automation and state-of-the-art AI capabilities, enabling your agents to understand context, generate relevant content, and make intelligent decisions based on semantic understanding. By connecting Agent Forge with OpenAI, you can create agents that process information more intelligently, generate creative content, and deliver more personalized experiences to users.

### Usage Instructions

Convert text into numerical vector representations using OpenAI's embedding models. Transform text data into embeddings for semantic search, clustering, and other vector-based operations.

### Tools

#### `openai_embeddings`

Generate embeddings from text using OpenAI

**Input**

| Parameter        | Type   | Required | Description                            |
| ---------------- | ------ | -------- | -------------------------------------- |
| `input`          | string | Yes      | Text to generate embeddings for        |
| `model`          | string | No       | Model to use for embeddings            |
| `encodingFormat` | string | No       | The format to return the embeddings in |
| `apiKey`         | string | Yes      | OpenAI API key                         |

**Output**

| Parameter    | Type   | Description          |
| ------------ | ------ | -------------------- |
| `embeddings` | json   | Generated embeddings |
| `model`      | string | Model used           |
| `usage`      | json   | Token usage          |

### Notes

* Category: `tools`
* Type: `openai`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/openai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
